简体   繁体   中英

PHP File upload not working

For some reason file upload is not working for this .ppt file that I am trying to upload. I have tested it with another ppt file (approximately 250kb) and it worked fine... but this one is 10mb and the $_FILE array is empty when I echo it. Can you guys tell me what I am doing wrong?? I know my PHP file is right.

index.php:

<form action="http://localhost:80/phpconverter/upload.php" method="post"
        enctype="multipart/form-data" target="upload_target">
    <input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE"
            value="102400000" />
    Choose a file to upload:
    <input id="fileName" name="uploaded_file" type="file" />
    <input type="submit" value="Upload"/>

    <iframe id="upload_target" name="upload_target" src="#"
        style="width:200px;height:500px;border:0px solid #fff;"> </iframe>
</form> 

When checking if the file is empty or not (ie empty($_FILES["uploaded_file"] ) I see that the file is empty, when I have in fact uploaded a file!!

Your file is too big and exceeds the PHP file default limit which is 2MB.

You have to increase upload_max_filesize and post_max_size in either php.ini or .htaccess file.

but this one is 10mb and the $_FILE array is empty when I echo it

The default PHP configuration places either a 2MB or 8MB limit on uploaded file sizes.

Please refer to the post_max_size and the upload_max_filesize configuration settings in your php.ini file. post_max_size must be equal to or larger than upload_max_filesize . These settings can not be changed at run-time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM