Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#5 | imagepicker-571198-HEAD.patch | 1.5 KB | Steven Jones |
#5 | imagepicker-571198-6--2.patch | 1.66 KB | Steven Jones |
#5 | imagepicker-571198-5--2.patch | 1.69 KB | Steven Jones |
Comments
Comment #1
hutch CreditAttribution: hutch commentedWhen 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.
Comment #2
Jaypan CreditAttribution: Jaypan commentedIn 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.
Comment #3
Steven Jones CreditAttribution: Steven Jones commentedI can confirm this issue with IE, and image picker 1.4.
Comment #4
Steven Jones CreditAttribution: Steven Jones commentedIE 8 sends:
'image/x-png'
Comment #5
Steven Jones CreditAttribution: Steven Jones commentedOkay 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.
Comment #6
hutch CreditAttribution: hutch commentedThank you for the patches, I will apply them to cvs shortly
M$Windows does it again ;-(
Comment #7
hutch CreditAttribution: hutch commentedpng-x bug applied to imagepicker, there are new stable versions for D5 and D6 and the devs will catch up later.
Comment #8
hutch CreditAttribution: hutch commented