ballhogjoni Posted March 24, 2009 Share Posted March 24, 2009 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 More sharing options...
bluejay002 Posted March 24, 2009 Share Posted March 24, 2009 If you are using apache... then you may also need to modify its configuration. Link to comment https://forums.phpfreaks.com/topic/150810-file-upload-problem/#findComment-792310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.