Hi
I'm modifying an upload script I have used to handle an upload within SSL secured space, and then to copy it over to a remote host (the non-SSL server).
I'm having problems getting is_uploaded_file to return true, even though I'm pretty sure it should be working.
I assume that provided I have a 'file' field in my form and I'm using enctype="multipart/form-data" that is_uploaded_file should be able to find the uploaded file without any further scripting....
My Form:
<form name="form" action="<=$PHP_SELF;?>" enctype="multipart/form-data">
<input type="file" name="the_file">
<input type="submit" name="Submit" value="UPLOAD">
</form>
I then call my upload function (relevent portion below):
$target_filename = $the_path .$id; // remote url
if (!is_uploaded_file($FILES['the_file']['tmp_name'])) {
print "Error uploaded file not found";
} elseif(!move_uploaded_file ($FILES['the_file']['tmp_name'], $target_filename)){
print "Copy of image failed";
}
Each time I run the script, I get "Error uploaded file not found"...
I'm using PHP 4.1.2, which should support this function as far as I can tell. I['ve tried using $HTTP_POST_FILES with the same results.
Before I started using is_uploaded_files, I could successully use copy() in it's place to upload to a local directory, but I need to up the security this time...
Anyone any ideas?