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 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
- Re: [PHP] File Upload: Help Needed Pushpinder Sngh Garcha
- Re: [PHP] File Upload: Help Needed Marek Kilimajer