.png file uploads fail
Jay Matwichuk - September 8, 2009 - 06:10
| Project: | Image Picker |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Sometimes, for some users, when trying to upload a .png file, I get an error that says something towards the effect of 'files must be .jpg or .png', yet the file is a .png file, with a .png extension.
I'm sorry I don't have more details, but this happened while I was showing a client the system, so I couldn't take screenshots or notes at the time. I converted the file to a .jpg, and it uploaded fine. Any ideas why this may be happening?

#1
When the browser sends an image up to the server it includes some metadata, in this case it should have sent type='image/png'
Apparently it sent something else, eg type='image/jpg' ;-(
Sometimes you get people who think that you can change an image's type by changing it's name, you reversed the process and it worked. Or something like that.
#2
In this case, I created the image myself in photoshop, and saved it as a .png file. It was then moved to a memory stick, and on to another computer, from where the upload was attempted. But there were no filetype or name conversions between that point, just media transfers.
If it happens again, I will upload the image here when it happens.
#3
I can confirm this issue with IE, and image picker 1.4.
#4
IE 8 sends:
'image/x-png'
#5
Okay the issue is that IE7 and later does the whole funny mime type thing with JPGs and PNGs. Imagepicker handles JPGs but not the PNG issue. Find attached patches for:
Marking critical as this issue is quite serious.
#6
Thank you for the patches, I will apply them to cvs shortly
M$Windows does it again ;-(
#7
png-x bug applied to imagepicker, there are new stable versions for D5 and D6 and the devs will catch up later.
#8
#9
Automatically closed -- issue fixed for 2 weeks with no activity.