Page 1 of 1

Problem with file upload!

Posted: Fri Dec 26, 2003 1:02 pm
by h@mm3r
When I fill out the form, that should upload a file into server and hit submit, no file appears to the server's temp directory... but the script still echos the temporary file (with the dir) name.

Example:
I choose a file named 'somewhile.jpg'.
Hit submit, and echo $HTTP_POST_FILES['fail']['tmp_name'];
This will output, for example "C:\uploaddir\php5A.tmp" or something...
But there's no files in the dir C:\uploaddir\ and PHP fails to copy the file to destination dir.

I thought there was no purpose to write here the php code, because it all worked on Linux. :S

I am running Apache 1.3
with PHP 4.2.2.

Posted: Fri Dec 26, 2003 1:33 pm
by AVATAr
show us your code

Posted: Fri Dec 26, 2003 2:10 pm
by Jim
Show us the code, please.

Other possible solutions:

1. Check your target directory permissions.
2. Don't use HTTP_POST_FILES. Use the $_FILES['form_name']['info'] global. (http://us3.php.net/manual/en/reserved.v ... bles.files)


A note...

"C:\uploaddir\php5A.tmp"

That would have to be the original location of the file - don't let that fool you in to thinking that's the file's destination. Make sure you check your code for the destination of the file.

Thanks! :)

Posted: Sun Dec 28, 2003 11:00 am
by h@mm3r
It's working now!!!

Thank you very much for the $_FILES['form_name']['info'] global!

Cheeerz!