Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. // Where the file is going to be placed
  3. $target_path = "uploads/";
  4.  
  5. /* Add the original filename to our target path.
  6. Result is "uploads/filename.extension" */
  7. $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
  8.  
  9. if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
  10. echo "The file ". basename( $_FILES['uploadedfile']['name']).
  11. " has been uploaded";
  12. } else{
  13. echo "There was an error uploading the file, please try again!";
  14. echo "filename: " . basename( $_FILES['uploadedfile']['name']);
  15. echo "target_path: " .$target_path;
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement