Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. if ( !empty($_FILES) ) {
  3. $file = $_FILES;
  4. var_dump ($file);
  5. //works for all jpg's except for phone camera jpg's :
  6. $tempFile = $file['file']['tmp_name'];
  7. $targetFile = 'somedir/foobar.jpg';
  8. if ( !move_uploaded_file($tempFile,$targetFile) ) {
  9. echo 'Unknown server error ';
  10. exit();
  11. }
  12. }
  13. ?>
  14.  
  15. array (size=5)
  16. 'name' => string 'IMG_20190717_101813958.jpg' (length=26)
  17. 'type' => string '' (length=0)
  18. 'tmp_name' => string '' (length=0)
  19. 'error' => int 1
  20. 'size' => int 0
  21.  
  22. array (size=5)
  23. 'name' => string 'IMG_20190717_afterPhotoshop.jpg' (length=31)
  24. 'type' => string 'image/jpeg' (length=10)
  25. 'tmp_name' => string 'C:wamp64tmpphp9884.tmp' (length=25)
  26. 'error' => int 0
  27. 'size' => int 2095408
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement