By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,757 Members | 1,990 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,757 IT Pros & Developers. It's quick & easy.

Problem in uploading files in php 4.5

P: n/a

I am using PHP 4.6 and trying to upload photograph on webpage but
getting $_FILES empty. checked php.ini file also hopefully its
; 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
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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

[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.

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.