Forum Moderators: coopster

Message Too Old, No Replies

PHP File uploads not working.

         

PSWorx

11:16 am on Dec 9, 2005 (gmt 0)

10+ Year Member



It seems my file uploads arnt working, ive taken snippets from a working script to do the following:

copy($_FILES['userfile']['tmp_name'], $imageDIR.$_FILES['userfile']['name'])or die("Could not copy");

I have various tests surrounding that snippet confirming submission of the file etc reports no errors, just wont upload the file to temp dir or the one i set as copy location. Changed and check php temp file dir and nothing is loaded in there either

Any help?

dreamcatcher

2:01 pm on Dec 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi PSWorx,

A few things to check.

1. Does the upload directory exist?

2. Is the upload directory writeable?

3. Are your variables coming from the form correctly? Try print_r($_FILES) to see the data populating the $_FILES array.

4. Are all your paths correct?

5. Echo $_FILES['userfile']['error'] for debugging.

dc

PSWorx

3:25 pm on Dec 9, 2005 (gmt 0)

10+ Year Member



Much appreciated on the reply, was a user error from my self, hadn't updated a variable name.

Thanks for the help