Jump to content

file upload problem


ballhogjoni

Recommended Posts

I am uploading a file that is 45 mb and I keep getting a files error of 1...I checked the docs and it said this error means that the file is to big. I turned off the max file size in the php.ini file but I still have this issue.

 

code:

if(!empty($_FILES["uploadedfile"]) && $_FILES['uploadedfile']['error'] == 0){
    print_r($_FILES["uploadedfile"]["size"]);exit;
    if($_FILES["uploadedfile"]["size"] <= 52428800){
        $filename = basename($_FILES['uploadedfile']['name']);
        $newname = dirname(__FILE__).'\uploads\\'.$filename;
        print_r($newname);
        if (!file_exists($newname)) {
            if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newname))) {
               echo "It's done! The file has been saved as: ".$newname;
            }else{
               echo "Error: A problem occurred during file upload!";
            }
        }else{
            echo "Error: File {$_FILES['uploaded_file']['name']} already exists";
        }
    }else{
        echo "File is to large. Please make the file smaller.";
        exit;
    }
}
?>
<form enctype="multipart/form-data" action="" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="52428800" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" onclick="submit_image();"/>
</form>
[code]

Link to comment
https://forums.phpfreaks.com/topic/150810-file-upload-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.