PDA

Click to See Complete Forum and Search --> : Possible to let the user know the image is too large


LionLN
Jan 29th, 2007, 12:59 PM
Technically I do not think its possible but thought I would ask. I have a form that contains multiple image upload fields, in the description we ask that the images size be smaller than 1mb but most people simple do not know how to check this.

Typically people will load each of the 5 image fields with an image over 2mb and wonder why the page timed-out or is blank after a couple of minutes.

Can PHP or something check this before the form gets rolling, then warn them about the size or time it will take to load these images?

CornedBee
Jan 29th, 2007, 04:49 PM
No, PHP can't do it. The PHP page processing starts only after everything has been uploaded.

However, there's a special hidden field you can use to give the browser a hint to disallow images over a certain size. I forgot the name.

kows
Jan 29th, 2007, 06:14 PM
it's called max_file_size, and you can use it like this:
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />