I have a simple script that attempts to upload a file and save it on the
server. When I click send file I get this error message 'Warning: Unable to
open '' for reading: No such file or directory in /var/www/html/upload.php
on line 5
Couldn't copy the file!'. The file is being uploaded from a Win 2000 machine
and the php script live on an apache web server on a linux box. I have chmod
777 the 'image' directory. Any ideas?
Here's the code -

                                -- upload.html --
<title>Upload a File</title>


<h1>Upload a File</h1>

<form enctype="multipart/form-data" method="post" action="upload.php">

<p><strong>File to Upload:</strong><br>
<input type="file" name="img1" size="30"></p>

<P><input type="submit" name="submit" value="Upload File"></p>



                                -- upload.php --

if ('img1' != "") {

        copy($img1_tmp_name, "images/".$img1_name)
                or die("Couldn't copy the file!");

} else {

        die("No input file specified");


This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to