Skip to main content
Known Participant
March 4, 2007
Question

restricting file upload size

  • March 4, 2007
  • 5 replies
  • 449 views
How do i restrict file upload size in pixels

this is what i have at the moment

File.MaxSize = 1024*1024
This topic has been closed for replies.

5 replies

Inspiring
March 5, 2007
You could just set your image placeholder on the page where the picture will be displayed to 350x250, but this can lead to problems if someone uploads a big file, and if the image isn't dimensionally equal you will get image distortions..

Another approach is to write, or find, a script that would resize the image when it gets uploaded. That would ensure that the image will fit perfectly within your design.
Inspiring
March 5, 2007
"rob dalton" <webforumsuser@macromedia.com> wrote in message
news:esfhlo$e6q$1@forums.macromedia.com...
> How do i restrict file upload size in pixels

The only foolproof solutions rely on server-side scripting. Client-side
validation for image dimensions can help. but it doesn't works across all
browsers. See the sample below and check the notes for browser
compatibility:
http://www.massimocorner.com/validator/samples/image_upload.htm

Hope it could help


--
----------------------------
Massimo Foti, web-programmer for hire
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com
----------------------------


Known Participant
March 5, 2007
right, my site only displays files 350 x 250 pixels. I dont want people uploading hugh files to the server, what size restriction would you recomend i set it to,
Inspiring
March 5, 2007
Well I am guessing that is where you would set the max file size, with the script you are using. You basically asnwered your own question.

Also, I just double read your post, and you cannot restrict a file based on pixels, you can only restrict a file on file size.
Inspiring
March 5, 2007
Where do you have that?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"rob dalton" <webforumsuser@macromedia.com> wrote in message
news:esfhlo$e6q$1@forums.macromedia.com...
> How do i restrict file upload size in pixels
>
> this is what i have at the moment
>
> File.MaxSize = 1024*1024