Welcome Guest, Not a member yet? Register   Sign In
image upload, mime check
#1

While trying to upload a particular png image, i kept getting disallowed file type. I tracked it to a wrong extension (which is not all that unusual and the image shows up ok in the image browser). In upload.php, getimagesize() was reporting the mime type as image/jpeg but in is_allowed_filetype() circa line 914, the mime check is done based on the file extension ie png so it was looking for "image/jpeg" in "[image/png,image/x-png]" and not finding it. Maybe the next issue of codeigniter might include an error message to say in such cases that the file extension is incorrect instead of giving the misleading impression that png files are not allowed.
Bill
Reply


Messages In This Thread
image upload, mime check - by badger - 02-28-2016, 07:37 AM
RE: image upload, mime check - by skunkbad - 02-28-2016, 12:39 PM
RE: image upload, mime check - by badger - 02-28-2016, 01:01 PM
RE: image upload, mime check - by InsiteFX - 02-28-2016, 04:00 PM
RE: image upload, mime check - by Narf - 02-28-2016, 11:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB