Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 18th, 2010 | Syntax: PHP | Size: 0.45 KB | Hits: 72 | Expires: Never
Copy text to clipboard
  1. <?php
  2.  
  3. $target_path = "upload_file/";//<wanru--change this to a folder u want the file to be with respect to this file.
  4.  
  5. $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
  6.  
  7. if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
  8.     echo "The file ".  basename( $_FILES['uploadedfile']['name']).
  9.     " has been uploaded  ";
  10. } else{
  11.     echo "There was an error uploading the file, please try again!  ";
  12. }
  13.  
  14. ?>