hi, all scripts that using this function $_FILES['*']['type'] to get type of file and compare it with allowed extention are failed to upload so i written a simple code to get information of uploaded file <?php echo ini_get("file_uploads"); if ( isset($_POST['send']) ) { if(!$_FILES['File1']['name']) echo "error"; else { echo '<pre>'; print_r($_FILES); echo'</pre>'; } } else { echo "<form method='post' enctype='multipart/form-data' action='test.php'> <input name='File1' type='file' /> <input name='send' type='submit' value='submit' /></form>"; } PHP: the output of this code is 1 Array ( [File1] => Array ( [name] => test.gif [type] => [tmp_name] => [error] => 1 [size] => 0 ) ) PHP: i tried to * change my browser * delete htaccess file * change max_execution_time but it still exist
What type of file are you uploading, is it a valid gif? Tested this locally with a jpeg and got this result: Array ( [File1] => Array ( [name] => t1126892861_8134.jpg [type] => image/jpeg [tmp_name] => C:\server\tmp\php586.tmp [error] => 0 [size] => 1031 ) ) Code (markup): Looking at your results... [error] => 1 gives a lot away. Add this code to the top of your page: error_reporting(E_ALL); PHP: and tell me any response. E.g. is tmp read/writable? Dan
every file i tried to upload i get same error i mailed support of server and them try to solve it 1 Array ( [File1] => Array ( [name] => 52202_1211219927.jpg [type] => [tmp_name] => [error] => 1 [size] => 0 ) ) PHP: i don't know they can solve it or not this error happen after upgrade php to php 5
They probably forgot to set the file upload_tmp_dir in the php.ini do an ini_get('upload_tmp_dir'); and check
Either the tmp directory is not set, the max upload size is too small or allow file upload is off. Peace,