File upload script works for desktop emulator, but not Android device

I am using the following script to receive uploaded images:

<?php
// File types allowed on upload:
$allowed_exts = array("gif", "jpeg", "jpg", "png");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/pjpeg")
|| ($_FILES["file"]["type"] == "image/x-png")
|| ($_FILES["file"]["type"] == "image/png"))
&& ($_FILES["file"]["size"] < 20000)
&& in_array($extension, $allowed_exts)) {
  if ($_FILES["file"]["error"] > 0) {
    echo "Not allowed Code: " . $_FILES["file"]["error"] . "<br>";
    }
  else {
    echo "Upload: " . $_FILES["file"]["name"] . "<br>";
    echo "Type: " . $_FILES["file"]["type"] . "<br>";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
    echo "Temp filename: " . $_FILES["file"]["tmp_name"] . "<br>";

/**
CUSTOMIZE THE NAME OF THE FOLDER THAT THIS PHP UPLOAD.PHP SCRIPT RESIDES IN.
uploads/
*/
      if (file_exists("uploads/" . $_FILES["file"]["name"])) {
      echo $_FILES["file"]["name"] . " already exists. ";
      }
    else {
	$timestamp = time();
	move_uploaded_file($_FILES["file"]["tmp_name"],
	$timestamp . "_" . $_FILES["file"]["name"]); // Add time to filename to minimize overwriting.
/**
CUSTOMIZE THE NAME OF THE FOLDER THAT THIS PHP UPLOAD.PHP SCRIPT RESIDES IN.
uploads/
*/
      echo "Stored in: uploads/" . $_FILES["file"]["name"];
      }
    }
  }
else {
  echo "Sorry, invalid file upload (this is from upload.php).";
  }
?>

It works very well when I turn on a desktop emulator, shoot a simulated picture from it and upload it. I can view the jpg files on the server. However, when I load the same HTML/JS script into an Android device, it fails to load, echoing the line:

echo "Sorry, invalid file upload (this is from upload.php).";

I wonder if you know why there would be a difference between the emulator and device in a case like this. I get code 200 when uploading from the device. Could the PHP code differential between types of JPG files, perhaps, accepting one and rejecting another? Just trying to isolate the issue.

I contacted server support to see if there is a block on the server side, but haven’t heard back from them yet.

It’s difficult to place this in the right forum because PHP is used as well as HTM/JS and a mobile device.

Oh, man I solved it! I merely changed 2000 to 10000 on this line:

&& ($_FILES["file"]["size"] < 20000)