Problem with file upload!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
h@mm3r
Forum Newbie
Posts: 10
Joined: Mon Nov 24, 2003 9:35 am

Problem with file upload!

Post 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.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

show us your code
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Post 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.
h@mm3r
Forum Newbie
Posts: 10
Joined: Mon Nov 24, 2003 9:35 am

Thanks! :)

Post by h@mm3r »

It's working now!!!

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

Cheeerz!
Post Reply