shaunie Posted February 16, 2012 Share Posted February 16, 2012 Hi, I have a strange problem with uploading files. My script was working fine on the test server but since moving to the live server it isn't working. Here is a printout of the FILES variable: Array ( [file] => Array ( [name] => filename.ppt [type] => [tmp_name] => [error] => 1 [size] => 0 ) ) Does anyone know what the problem might be? The error message that comes back is 'Invalid file'. function upload_ppt_files() { echo 'print_r($_FILES) = '.print_r($_FILES).'<br />'; global $CFG; if (($_FILES["file"]["type"] == "application/vnd.ms-powerpoint") && ($_FILES["file"]["size"] > 100)) { if ($_FILES["file"]["error"] > 0) { $CFG->message = "Error code:". $_FILES["file"]["error"]; manage_ppt_files(); } else { if (file_exists("../../uploads/" . $_FILES["file"]["name"])) { $CFG->message = $_FILES["file"]["name"] . " already exists."; manage_ppt_files(); } else { move_uploaded_file($_FILES["file"]["tmp_name"], "../../uploads/" . $_FILES["file"]["name"]); $CFG->message = "File uploaded successfully."; manage_ppt_files(); } } } else { $CFG->message = "Invalid File."; manage_ppt_files(); } } Link to comment https://forums.phpfreaks.com/topic/257144-uploading-files-problem/ Share on other sites More sharing options...
scootstah Posted February 16, 2012 Share Posted February 16, 2012 From the manual, Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini. Link to comment https://forums.phpfreaks.com/topic/257144-uploading-files-problem/#findComment-1318172 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.