Re: File Upload: Help Needed
| From: | Marek Kilimajer | Date: | Wed, 13 Nov 2002 18:57:13 +0000 |
| Subject: | Re: File Upload: Help Needed | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124281@lists.php.net to get a copy of this message | ||
The directory must exists prior to copy, and must be writeable by the server process.
Also note this is a filesystem path.
Pushpinder Sngh Garcha wrote:
Hi I am trying to upload a file using php. This is the code that I am using for the php script called "upload.php" <html> <? if(!empty($userfile)) { //copy the file to some permanent location copy($userfile, "/upload/myfile.txt"); //destroy the file unlink($userfile); //display message echo("file uploaded"); } ?> </html> This is my html page that calls the script <html> <form action="upload.php" method=post enctype="multipart/form-data"> submit this file: <input type=file name="userfile"><br> <input type=submit><br> </form> </html> I am creating a directory called "upload" in the website. When I run the script I get this error: "Warning: Unable to create '/upload/myfile.txt': No such file or directory in /home/MATmas/upload.php on line 5 file uploaded Hi There ! " Please help me out.. --Pushpinder Pushpinder Singh Garcha _________________________________ Web Developer T. Falcon Napier and Associates, Inc.Off : 704 987 6500Cell : 704 236 2939 Fax : 704 987 5002 _________________________________