After looking for a way to limit the size of images being uploaded to a database, I found a recommendation here to use GetImageSize().

It works like a charm, but I've noticed that it simply returns "false" with files of more than about 200KB. Is this normal behaviour?

    Have you looked at the discussions here? There seem to be some suggestions there that you might try.

      If it's an uploaded image why don't you just test the size of the file while it's still in the $FILES array.

      $userfile = $_FILES['userfile'];
      $filesize = $userfile['size'];
      
      if($filesize > 200000) {            // No larger than 2MB
          reject_file();
      } else {
          accept_file();
      }
      
        Write a Reply...