Hello,

I'm working on some code to check the filesize() of an uploaded image file to make sure that it is not larger than the amount specified in the global MAX_FILE_SIZE.

However, if the submitted file is larger than the MAX_FILE_SIZE then the function presently returns the following error:

Warning: stat failed for (errno=2 - No such file or directory) in /home/quickoff/public_html/listings/dsp_admin.php on line 69

I'm wondering if there's a better way to go about this... or if I should just try to catch this error and only allow the image upload to continue if the error doesn't exist.

Any suggestions?

Thanks!

    If your image is held in the variable $img from the form you can check the file size by comparing to

    $img_size

    you can also see what type of image is returned by echoing

    $img_type

    I hope this is what you were asking

      hi tashbee,

      i appreciate the reply, but i think that i'm having a different problem at the moment.

      $binFile_size returns zero as the image doesn't seem to be on the server yet.

      john

        Write a Reply...