当前位置: 动力学知识库 > 问答 > 编程问答 >

forms - after changing the file upload limit size in php.ini, still doesn't work

问题描述:

I want to upload the file to my local server, but only small size files worked, if the file size exceeds certain value, then it can not find the uploaded file.

if (isset($_FILES["fileToUpload"]["tmp_name"])) {

$fileUploaded = move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], "./uploads/".$_FILES["fileToUpload"]["name"]);

} else {

die("Error uploading file. Please contact an administrator");

}

Then I changed the upload_max_filesize and post_max_size in php.ini, restart apache, but the problem still exists, couls you help me on that? thanks so much.

update:

1. only one file will be uploaded.

2. Small-size file like less than 2 MB could be uploaded successfully. I tested an 10 MB file, it failed.

3. I changed the two parameters upload_max_filesize and post_max_size from 2 MB to 100 MB.

网友答案:

So you can see what actual error is being generated try this code

if ( isset($_FILES["fileToUpload"]) ) {
    print_r($_FILES);
}

Then look at the [error] array and see what error is actually being reported.

Then check this page in the manual to see what the numbers mean.

分享给朋友:
您可能感兴趣的文章:
随机阅读: