Image upload in Windows changes filename to lowercase
|Reported by:||Rob van der Linde||Owned by:||Chris Beaven|
|Severity:||Normal||Keywords:||upload image lowercase|
|Cc:||Armin Ronacher||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)
Changed 8 years ago by
comment:20 Changed 6 years ago by
|Owner:||set to Chris Beaven|
|Status:||new → closed|