Reply
Possible to let the user know the image is too large
Old 01-19-2007, 03:49 PM Possible to let the user know the image is too large
Junior Talker

Posts: 3
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?
Nori M is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 01-20-2007, 05:50 AM
$1,000 - $4,999 Monthly

Posts: 164
It is not possible to look at the file on the client's hard drive before it is uploaded (which you would need to do to determine the size).

The only solution I can think of is to use an uploading script that instead of timing out the page, will abort the upload if it takes too long and then warn the user that their image was probably too large. I do not know of any such scripts however.

Most sites don't worry about the timing out, and just check the file size AFTER it is uploaded.
Elemak is offline
Reply With Quote
View Public Profile Visit Elemak's homepage!
 
Old 01-20-2007, 09:39 AM
Junior Talker

Posts: 1
Location: Chennai India
Unless you create a custom activex or java upload utility it is not possible to know the size if the file before the actual upload is completed.

Reading the uploaded headers and binary data and stopping midway once a particular size is reached is also another option but complicated
__________________
Chris, Director, Chrisranjana.com
Php Java Asp C# programmers and web developers
chrisranjana is offline
Reply With Quote
View Public Profile Visit chrisranjana's homepage!
 
Old 01-29-2007, 05:26 PM
roeinstein's Avatar
Junior Talker

Posts: 6
Check out the GD libraries for PHP. Do a google search for 'php-gd'
__________________
Lee's Design Guy (see: eliteretreat.info and leedodd.com)
roeinstein is offline
Reply With Quote
View Public Profile Visit roeinstein's homepage!
 
Old 01-29-2007, 05:35 PM
Junior Talker

Posts: 82
This is totally possible. let the user upload the file, run a script nad if the file is > 1mb delete the file from the server and send the user to an error page saying "YOU EEEDIOT!"
dprundle is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Possible to let the user know the image is too large
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12563 seconds with 12 queries