I am trying to upload a file using php.
This is the code that I am using for the php script called "upload.php"

if(!empty($userfile)) {

//copy the file to some permanent location
copy($userfile, "/upload/myfile.txt");

//destroy the file

//display message
echo("file uploaded");

This is my html page that calls the script


<form action="upload.php" method=post enctype="multipart/form-data">
submit this file: <input type=file name="userfile"><br>
<input type=submit><br>

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 Singh Garcha
Web Developer
T. Falcon Napier and Associates, Inc.
Off : 704 987 6500
Cell : 704 236 2939
Fax : 704 987 5002

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

Reply via email to