I'll have to test, but I think the $filename = "/tmp/".$userfile is what's
messing things up.
 
$userfile is a link to the temporary file the system creates when storing
the uploaded file.  The link includes a full reference to the file name as
well as the system directory path to the file.  Appending /tmp/ in front of
this creates an invalid path for $filename.
 
Create a $filename as a valid path and file name.  Use the move function to
move from $userfile to $filename.  That way you don't end up with an extra
left over file wasting drive space.
 
Try that and lemme know how it goes =)
 
-Ed
 

-----Original Message-----
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 02, 2002 4:14 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] upload problems - "unable to open 'none'


Here is the code.  $userfile is the name of the upload field.  I doubled
checked the HTML and everything is fine with it.
 
hey man, thanks for all your help!!
 
$filename = "/tmp/".$userfile;
if (!copy($userfile, $filename))
{
 echo "something barfed.";
 exit;
}
 
else
{
 echo "uploaded.";
}


>>> "Lazor, Ed" <[EMAIL PROTECTED]> 07/02/02 04:38PM >>>
Send us a copy of your script so that we can help.  Odds are that you didn't
specify the proper field name in your upload form.

-----Original Message-----
Now I'm getting this error each time I upload a file...

Warning: Unable to open 'none' for reading: No such file or directory
in /home/.../upload3.php on line 7

why is it saying 'none' ??

****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.                                                                       


 
****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.                                                                       

Reply via email to