This is a discussion on Problem in uploading files in php 4.5 within the PHP Language forums, part of the PHP Programming Forums category; Hello I am using PHP 4.6 and trying to upload photograph on webpage but getting $_FILES empty. checked php....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello
I am using PHP 4.6 and trying to upload photograph on webpage but getting $_FILES empty. checked php.ini file also hopefully its correct. ******************************* ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ;upload_tmp_dir = ; Maximum allowed size for uploaded files. upload_max_filesize = 2M ******************************* Also I have used this same function with PHP 4.1 where it worked fine. but don't know why it is returning null value of $_FILES in php4.6 |
|
|||
|
hi,
i think you have to spacify the temp directory in php.ini file first so check this upload_tmp_dir ="C:\php\your_temp_dir" (windows paltform) where (your_temp_dir) is the temprory directory on your server if you fix this we can check the following : 1-check $_FILES if it have data or not by using ------------------------------------------------------------------------- echo "<pre>"; //nothing imoprtant only HTML tag print_r($_FILES ); //to print the array (keys and values) echo "</pre>"; //nothing imoprtant only HTML tag ------------------------------------------------------------------------ if $_FILES array is not empty you will find somthing like this Array ( [mycontrol] => Array ( [name] => php.gif [type] => image/gif [tmp_name] => C:\php\upload\phpB.tmp [error] => 0 [size] => 3872 ) ) -------------------------------------------- if you have somthing like this that mean you are ok and the $_FILES array is filled -------------------------------------------- have good time. |