xls & html uploaded as image - mime type validation failed?

See all posts See thread Reply

Re: xls & html uploaded as image - mime type validation failed? new!
by colin, 15 years, 3 months ago
Note that you try with this new version 0.28RC4, it has stronger MIME type detection, and more extensive logging.

The supported image types : png jpg gif bmp is only stating what GD can handle. No relation with the file you are uploading.

For your issue: if you use the test files provided with the class, you can indeed upload a regular file with the action=image form. As long as the MIME type validation is OK, your file will be uploaded; Then, in the action=image case, it will try to resize the image. But because your file is not an image, it doesn't do any image manipulation, it just uploads.

If you want to restrict the type of files to images only, do something like:
$handle->allowed = array('image/*');
Reply