Image upload in Windows changes filename to lowercase
|Reported by:||robvdl||Owned by:||SmileyChris|
|Severity:||Normal||Keywords:||upload image lowercase|
|Cc:||mitsuhiko||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When using an ImageField and uploading an image via admin, say the filename was Test.jpg, uploading it in Linux will save the file as Test.jpg on the disk, and the reference in the database is also Test.jpg, things work normally as expected here.
However, when uploading the same file in Windows, the filename is saved on the disk as test.jpg (all lower case), but in the database is still referenced as Test.jpg. Since the filesystem in Windows is not case sensitive, this is not really much of an issue immediately. If you however, then copy your Django based site back to a Linux based machine, you will get a missing image, as it is expected to find the file "Test.jpg" in the filesystem, however the file is "test.jpg". In this case, this can become a bit of a problem.
I am not sure if the problem is related to Django or Python on Windows.
Change History (26)
comment:1 Changed 7 years ago by anonymous
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 follow-up: ↓ 6 Changed 6 years ago by SmileyChris
- Triage Stage changed from Unreviewed to Accepted
Changed 4 years ago by SmileyChris
comment:20 Changed 4 years ago by SmileyChris
- Owner set to SmileyChris
- Resolution set to fixed
- Status changed from new to closed