Results 1 to 3 of 3

Thread: Possible to let the user know the image is too large

  1. #1

    Thread Starter
    Banned
    Join Date
    Jan 2007
    Posts
    2

    Possible to let the user know the image is too large

    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?
    Last edited by si_the_geek; Feb 5th, 2007 at 01:22 PM. Reason: removed advertising links

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Possible to let the user know the image is too large

    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Possible to let the user know the image is too large

    it's called max_file_size, and you can use it like this:
    Code:
    <input type="hidden" name="MAX_FILE_SIZE" value="1000000" />

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width