Limiting the image size for an upload...

Results 1 to 2 of 2

Thread: Limiting the image size for an upload...

  1. #1
    Join Date
    Dec 1969

    Default Limiting the image size for an upload...

    How would I limit the width, height, file size(k) and extension type when giving a user the option to upload an image?<BR><BR>I want to encourage personalization, but I want the graphics to conform to a specific placeholder template. I also don&#039;t want someone uploading a 3 meg graphic.

  2. #2
    Join Date
    Dec 1969

    Default You can't do it before the upload...

    .. unless you get fancy with some DHTML script. Even then, I don&#039;t think FileSize would work.<BR><BR>But, most Upload Objects allow you to specify a maximum filesize to upload. Once that limit is reached, it just stops uploading. If you set that max limit to be 5k larger than you want to allow uploaded, you can then check to see if the file is larger than what you wanted to allow. If so, return an error.<BR><BR>As for height, width and filetype, there was a script on a long time ago that let you get height, width and the filetype of .gif, .jpg, and .png files. Search it out. You can then check that the uploaded file conforms to your standard.<BR><BR>-Doug

Posting Permissions

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