Php file Upload always failed http://www.w3school.com.cn/php/php_file_upload.asp
I looked at this example, but when I was elected a file and clicked Upload, Error 6 appeared. I was in php. in ini, set upload_tmp_dir to upload_tmp_dir = "C: \ WX" and click upload to display the Invalid file. the file cannot be uploaded.
Reply to discussion (solution)
In general, the upload and storage directories cannot be written. You have to set it up.
Index.html code
Untitled Document
Upload_file.php code:
0) { echo "Error: " . $_FILES["file"]["error"] . "
"; }else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; }?>
Index.html code
Untitled Document
Upload_file.php code:
0) { echo "Error: " . $_FILES["file"]["error"] . "
"; }else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; }?>
You do not need to modify the content in php. ini. restore it and try again.
You do not need to modify the content in php. ini. restore it and try again.
I have uninstalled and re-installed the software, but still failed to upload files. I don't know what the problem is. I found it difficult to install and configure these open-source software, various errors are also a headache. Is there a solution ??
Index.html code
Untitled Document
Upload_file.php code:
0) { echo "Error: " . $_FILES["file"]["error"] . "
"; }else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; }?>
$ _ FILES ["file"]
Print the variable and check what it is.
print_r($_FILES["file"]);exit;
Error: 6
Indicates that the uploaded file does not exist.
You 'd better set upload_tmp_dir to D: that is, later Drive
Because C: Generally, the drive is set to prohibit file operations by anonymous users.
$ _ FILES ['file'] ['error']
The value is 0. If no error occurs, the file is uploaded successfully.
The value is 1, and the uploaded file exceeds the limit of the upload_max_filesize option in php. ini.
The value is 2, and the size of the uploaded file exceeds the value specified by the MAX_FILE_SIZE option in the HTML form.
The value is 3, and only part of the file is uploaded.
The value is 4 and no file is uploaded.
The value is 6 and the temporary folder cannot be found. PHP 4.3.10 and PHP 5.0.3 are introduced.
If the value is 7, the file fails to be written. PHP 5.1.0 is introduced.
If an error is reported, the temporary folder does not have the write permission or does not exist.
Error: 6
Indicates that the uploaded file does not exist.
You 'd better set upload_tmp_dir to D: that is, later Drive
Because C: Generally, the drive is set to prohibit file operations by anonymous users.
Moderator, please help me. when I read this blog, I have already handled this issue at http://blog.csdn.net/k8080880/article/details/6193060.
IUSR_7195F2AD8ACB471 and IWAM_7195F2AD8ACB471 are added to the D: // r // Directory, php. ini changes upload_tmp_dir = "D:/r". why is ERROR: 6 still displayed during file uploading? according to "wzb0712", the value is 6 and the temporary folder cannot be found. PHP 4.3.10 and PHP 5.0.3 are introduced. This problem cannot be solved. ask the moderator for help.
Http://www.w3.org/TR/html4/loose.dtd>
Untitled Document
Install a wamp.
It may be related to the file size. the error is that the temporary file does not exist, that is, writing problems.
It may be related to the file size. the error is that the temporary file does not exist, that is, writing problems.
I tried a lot of methods, but they still don't work.
Code http://www.w3school.com.cn/php/php_file_upload.asp here
Why is this happening? How can this problem be solved? Guidance from the cool.
It may be related to the file size. the error is that the temporary file does not exist, that is, writing problems.
I tried a lot of methods, but they still don't work.
Code http://www.w3school.com.cn/php/php_file_upload.asp here
Why is this happening? How can this problem be solved? Guidance from the cool.
Http://yunpan.cn/QUFvS5gnx2Wzi this is what I wrote before, file upload function, very simple, written before, you can refer
It may be related to the file size. the error is that the temporary file does not exist, that is, writing problems.
I tried a lot of methods, but they still don't work.
Code http://www.w3school.com.cn/php/php_file_upload.asp here
Why is this happening? How can this problem be solved? Guidance from the cool.
Http://yunpan.cn/QUFvS5gnx2Wzi this is what I wrote before, file upload function, very simple, written before, you can refer
This is also an error. I don't know why. I believe that your code and w3school are okay. it may be a system problem or another cause. I will try again in another system ..
It may be related to the file size. the error is that the temporary file does not exist, that is, writing problems.
I tried a lot of methods, but they still don't work.
Code http://www.w3school.com.cn/php/php_file_upload.asp here
Why is this happening? How can this problem be solved? Guidance from the cool.
Http://yunpan.cn/QUFvS5gnx2Wzi this is what I wrote before, file upload function, very simple, written before, you can refer
This is also an error. I don't know why. I believe that your code and w3school are okay. it may be a system problem or another cause. I will try again in another system ..
I don't know what environment you are using. we recommend that you install the integrated environment. we recommend that you use wampserver. generally, it is okay. or you can download an upload function written by someone else and test whether the function can be uploaded, find the reason.