I'm trying to create a form to upload a file. It all seems fairly straightforward. I've tried three or for different pages/scripts that I've gotten from places and none of them have worked, though.
I have done the following:
checked all the upload max, memory limit, etc. sizes
ensured that permissions of all folders that are being written to are writeable (chmod 777)
and read everything I can find on this to no avail!
My guess is that the file is not getting copied to the temp directory, but I don't know where to go from there... Any feedback would be much appreciated!
The error that I get in my log is:
Warning: copy(\www\anonftp emp) [<a href='http://www.php.net/function.copy'>function.copy</a>]: failed to create stream: No such file or directory in /home/www/printingtech/upload_go.php on line 6
PHP Notice: Undefined variable: userfile in /home/www/printingtech/upload_go.php on line 32
PHP Notice: Undefined variable: userfile_name in /home/www/printingtech/upload_go.php on line 35
PHP Notice: Undefined variable: newname in /home/www/printingtech/upload_go.php on line 38
PHP Notice: Undefined variable: userfile_size in /home/www/printingtech/upload_go.php on line 44
PHP Notice: Undefined variable: userfile_type in /home/www/printingtech/upload_go.php on line 47
The script (upload_go.php) is
<?php
function do_upload($filename,$newname) {
$file = basename($filename);
$tmp_upload_path = "\www\anonftp\temp";
$new_file_name = "\www\anonftp\incoming\".$newname;
if (!copy($tmp_upload_path.$file, $new_file_name)) echo "failed to copy file<br>\n";
return;
}
?>
<HTML>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
<?php
do_upload($userfile,$newname);
?>
Thanks
Sarah