upload text file


#1

hi…i try to upload file…but got error…here i submit my coding…
#uploadForm1
[php]

# of Files to Upload Choose a file to upload:


          [/php]

#uploader
[php]

Untitled Document <?php // Where the file is going to be placed $target_path = "uploads/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $_FILES['uploadedfile']['tmp_name']; $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } ?> [/php] the error i got is
Warning: move_uploaded_file(uploads/printer.txt): failed to open stream: No such file or directory in c:program fileseasyphp1-7wwwsmttuploader.php on line 16

Warning: move_uploaded_file(): Unable to move ‘C:Program FilesEasyPHP1-7tmpphp7B.tmp’ to ‘uploads/printer.txt’ in c:program fileseasyphp1-7wwwsmttuploader.php on line 16
There was an error uploading the file, please try again!


#2

What’s the outcome of using is_uploaded_file()?


#3

1/ Check that “uploads” folder exists and that it is writable.
2/ Check that “printer.txt” file do not exists or if exists that php have rights to overwrite it.

As far as Iremember similar errors can happen on win NT based systens (nt2000, nt2003 etc).

hope this will help