uploaded file not returning a valid file type attribute?
I can't underst开发者_StackOverflow中文版and why my file uploaded through a form that used to be working just fine, is now returning an empty image type. Below is the printed array of $_FILES:
[file] => Array ( [media_image] => Array ( [name] => 001_ac.jpg [type] => [tmp_name] => [error] => 1 [size] => 0 )
According to the File error #1, the file you are uploading is larger than the upload_max_filesize allowed in php.ini. See the error codes in the manual here: http://php.net/manual/en/features.file-upload.errors.php
Hence, the file upload is being rejected, so it hasn't got a size or most of its other normal attributes. Your code can check for such errors and handle them by giving the user feedback, such as informing them of file size restrictions, file types, etc.
精彩评论