开发者

PHP5 $_FILES[][] notice error - Undefined

开发者 https://www.devze.com 2023-03-09 08:02 出处:网络
I am trying to upload a file to my server using php5 script. And I am receiving an notice error Undefined index: qqfile.

I am trying to upload a file to my server using php5 script. And I am receiving an notice error Undefined index: qqfile.

$_FILES['qqfile']['tmp_name']

But I don't know how it is not defined from the previous script. The "tmp_name" is there in the array, but qqfile is s开发者_如何学Chowing UnDefined...


if $_FILES['qqfile'] doesn't exist, then neither could ['tmp_name']. Do a var_dump($_FILES) to see what's really in there. Note that if your file upload form doesn't haven the following format, the file upload will NOT work:

<form action="yourscript.php" method="POST" enctype="multipart/form-data">
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MUST BE present


Most of time it's because the file uploaded is greater than the limit setted into php.ini.

Try to upload a small file and see if it's works.

Btw there isn't any "undefined" type in PHP. And it's impossible that exists $_FILES['qqfile']['tmp_name'] but not only $_FILES['qqfile']

Regards php.ini you should see the value of:

ini_set('post_max_size',); 
ini_set('upload_max_filesize',); 
ini_set('max_input_time', );

Are you sure you have a

<input type="file" name="qqfile" />

?

0

精彩评论

暂无评论...
验证码 换一张
取 消