Skip to main content
Participant
May 31, 2007
Question

Check Image Size before Upload

  • May 31, 2007
  • 3 replies
  • 517 views
Check Image Size before Upload using form with two browse button.
I am using CGI.CONTENT_LENGTH to fetch the Image Size,but it is giving be the total size of the images I am selecting from two browse button.I need the image size of one selected by first browse button and second button seperalty. But not able to find the code to check the Image Size seperalty through a single form(with two browe buttons).
Can anybody help me out.
This topic has been closed for replies.

3 replies

tclaremont
Inspiring
May 31, 2007
Keep in mind that CF is a server side solution. CF is not aware of the file size until the file actually reaches the server.

Because of this, as alluded to above, a client side solution such as javascript / flash, etc must be used in combination with CF to accomplish the task.
Inspiring
May 31, 2007
Azadi is correct. You cannot do it prior to uploading.

Yet the folks over at ASFusion.com have put together a flash based upload form that you can specify the max file size, and when the user is browsing for the file, anything that doesn't meet the file size limit will not show up as a file.

http://www.asfusion.com/examples/item/file-upload-with-coldfusion-flash-forms


There may be a few AJAX solutions that you may be able to do something similar, yet I don't know of any off the top of my head.
Inspiring
May 31, 2007
not possible without uploading the images, i believe...

--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com