$_FILES field 'tmp_name' has no value on .JPG file extension

前端 未结 7 2034
时光取名叫无心
时光取名叫无心 2020-11-29 07:53

i was making an upload script when i tested an image file wit this extension .JPG, i don\'t know whats the difference between jpg or jpeg, but it seems that $_FILES don\'t r

7条回答
  •  情歌与酒
    2020-11-29 08:43

    I faced the issue with $_FILES field 'tmp_name' having no value for .JPG file extension and successfully fixed it in few steps. These measures may help someone in the future.

    1. First of all, I implemented the Switch Case solution offered by the user 'staticsan'. Link here - https://stackoverflow.com/a/14472801/3681985. This solution helped me trace the potential issues such as parameters in php.ini file and folder permissions.
    2. The php.ini file was named php.ini.default. Changing the parameters upload_max_filesize and post_max_size didn't yield any result, until I renamed the file to php.ini. Remember to experiment with parameter values.
    3. After fixing the file name issue, I encountered a challenge with the permissions to the folder in which the uploaded temp image has to be moved. I have changed the permissions and was able to see the image uploaded in to the folder.

提交回复
热议问题