1

what should the value be instead of 2000... for uploading a 5mb file?

   if ((($_FILES["upload"]["type"] == "image/gif")
    || ($_FILES["upload"]["type"] == "image/jpeg")
    || ($_FILES["upload"]["type"] == "image/jpg")
    || ($_FILES["upload"]["type"] == "image/pjpeg")
    || ($_FILES["upload"]["type"] == "image/x-png")
    || ($_FILES["upload"]["type"] == "image/png"))
    && ($_FILES["upload"]["size"] < 200000000)
    && in_array($extension, $allowedExts)) {
      if ($_FILES["upload"]["error"] > 0) {
        echo "Return Code: " . $_FILES["upload"]["error"] . "<br>";
      } else {
        echo "Upload: " . $_FILES["upload"]["name"] . "<br>";
        echo "Type: " . $_FILES["upload"]["type"] . "<br>";
        echo "Size: " . ($_FILES["upload"]["size"] / 1024) . " kB<br>";
        echo "Temp file: " . $_FILES["upload"]["tmp_name"] . "<br>";
Keertan
  • 115
  • 10

2 Answers2

1

For 5MB use this:

5242880

Since 5MB = 5242880 Bytes

(A quick google search or brain calculation :D)

Rizier123
  • 58,877
  • 16
  • 101
  • 156
1

You can put 5242880 for 5MB. You can use this site for conversion. http://www.onlineconversion.com/computer_base2.htm