Advertisement
Guest User

Uploading

a guest
Sep 7th, 2014
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. if(count($_FILES) > 0){
  5. if(move_uploaded_file($_FILES['picture']['tmp_name'] , 'test'.DIRECTORY_SEPARATOR.$_FILES['picture']['name'])){
  6.  
  7. echo "File uploaded successfully";
  8.  
  9. }else{
  10.  
  11. echo "Error";
  12.  
  13. }
  14. }
  15.  
  16. ?>
  17. <form method = "POST" enctype = "multipart/form-data">
  18.  
  19. <input type = "file" name = "picture"/>
  20. <input type = "submit" value = "Upload image"/>
  21.  
  22. </form>
  23. <?
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement