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>";
0

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

For 5MB use this:

5242880

Since 5MB = 5242880 Bytes

(A quick google search or brain calculation :D)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.