I was using the File Upload tutorial from Julie Meloni's thickbook.com site
and it looks simple enough but I can't copy the file mainly because it is
looking in the wrong spot for the file I browsed to.  Some help would be
appreciated, I have a class that I want to teach this to.

For instance, I browse to a file at this location:
C:\WINNT\Profiles\jgarcia\Desktop\release.bat and I get the error below.
Line 41 is where I have my copy command.

Warning: Unable to create 'c:\Program Files\Apache
Group\Apache\htdocs\uploads\release.bat': No such file or directory in
c:\program files\apache group\apache\htdocs\class\uploadsuccess.php on line
41
Couldn't copy the file!


Here is my PHP code:


<?php


print "The file name is: <b>".$theFile_name."</b><br>";
print "The file size is: <b>".$theFile_size."</b><br>";
print "The file type is: <b>".$theFile_type."</b><br>";
print "The temp file name is: <b>".$theFile."</b><br>";

// if $img_name isn't empty, try to copy the file
if ($theFile_name != "") {

 // copy the file to a directory or
 file:// die and print an error message

 // NOTE! if you're on a Windows machine,
 // use Windows pathnames, like so:
 // copy("$theFile", "C:\\some\\directory\\path\\$theFile_name");

 copy("$theFile", "c:\\Program Files\\Apache
Group\\Apache\\htdocs\\uploads\\$theFile_name")
  or die("Couldn't copy the file!");

} else {

 // if $img_name was empty, die and let us know why
 die("No input file specified");

}

print "Your file has been sucessfully uploaded!";
?>


My html code is:

<form name=myform action=uploadsuccess.php enctype="multipart/form-data"
method=post>
<input type="hidden" name="MAX_FILE_SIZE" value="25000">

Browse to the file for uploading: <input type=file name=theFile size=30>
<br>

<input type=submit value="Upload File">



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to