Posted By

saturngod on 03/23/10


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

BrianCoyDesign
joacoleo


Upload file


 / Published in: PHP
 

  1. $target_path = "uploads/";
  2.  
  3. $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
  4.  
  5. if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
  6. echo "The file ". basename( $_FILES['uploadedfile']['name']).
  7. " has been uploaded";
  8. } else{
  9. echo "There was an error uploading the file, please try again!";
  10. }

Report this snippet  

You need to login to post a comment.