2

Im using the below code to move a uploaded file into a location in server.

if( $_FILES)
    move_uploaded_file($_FILES['newfile']['tmp_name'][0], "uploads".DIRECTORY_SEPARATOR."jersey".DIRECTORY_SEPARATOR.$jersey_id.DIRECTORY_SEPARATOR."jersey_logo_".$_FILES['newfile']['name'][0]);

The above code works fine, when i use browser in my pc. But the same fails when using mobile browser's camera and files selected from camera folder and the same works if files are selected from other folders.

The $_FILES array is followsenter image description here

what will be the reason?

arun
  • 4,595
  • 5
  • 19
  • 39
  • have you looked into `$_FILES` array? – Jeff Jun 18 '17 at 10:06
  • 4
    The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size. Depending on your host, changing these two PHP variables can be done in a number of places with the most likely being php.ini or .htaccess (depending on your hosting situation)... Check this https://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size – Nono Jun 18 '17 at 12:51
  • @NeerajSingh, u r legend – arun Jun 19 '17 at 04:16
  • 1
    @arun call me Super Saiyan ;) I am Goku's friend.. Ha Ha ha...:) – Nono Jun 19 '17 at 04:38
  • @Neeraj Singh you solved my 5 hours problem. thanks, you are legend XD – Aria5h4h Apr 27 '20 at 09:04

0 Answers0