verot / class.upload.php

This PHP class uploads files and manipulates images very easily. It is in fact as much as an image processing class than it is an upload class. Compatible with PHP 4, 5, 7 and 8. Supports processing of local files, uploaded files, files sent through XMLHttpRequest.
http://www.verot.net/php_class_upload.htm
GNU General Public License v2.0
847 stars 358 forks source link

0 byte files rejected as Incorrect File Type #118

Closed zanderwar closed 5 years ago

zanderwar commented 5 years ago

Uploading a .txt file of size 0 bytes periodically returns "Incorrect file type"

Is this intended? I understand it's unorthodox to upload a file with nothing in it but none-the-less the mime type is valid and should be allowed through

verot commented 5 years ago

On my system, such an empty file has a MIME of inode/x-empty.

If you wish to accept such files, you can add it to the $allowed array of MIME types.

zanderwar commented 5 years ago

Right, agreed that it does come through with that mime-type, thanks @verot