Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( !empty($_FILES) ) {
- $file = $_FILES;
- var_dump ($file);
- //works for all jpg's except for phone camera jpg's :
- $tempFile = $file['file']['tmp_name'];
- $targetFile = 'somedir/foobar.jpg';
- if ( !move_uploaded_file($tempFile,$targetFile) ) {
- echo 'Unknown server error ';
- exit();
- }
- }
- ?>
- array (size=5)
- 'name' => string 'IMG_20190717_101813958.jpg' (length=26)
- 'type' => string '' (length=0)
- 'tmp_name' => string '' (length=0)
- 'error' => int 1
- 'size' => int 0
- array (size=5)
- 'name' => string 'IMG_20190717_afterPhotoshop.jpg' (length=31)
- 'type' => string 'image/jpeg' (length=10)
- 'tmp_name' => string 'C:wamp64tmpphp9884.tmp' (length=25)
- 'error' => int 0
- 'size' => int 2095408
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement