> // Declare a new image to obtain math values > x=new Image; > x.src=element.value; > is=Math.ceil(x.fileSize/1000); > > This is a snippet of an old piece of javascript that I used for previewing > and uploading multiple image files. I'm not 100% that I got the file size > preview to work but I think I did.
Before you can check an image's size with JavaScript you have to wait for its onload event to fire. An example of clien-side image upload validation is visible below, please read the notes about browser's compatibility: http://www.massimocorner.com/validator/samples/image_upload.htm ---------------------------- Massimo Foti, web-programmer for hire Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ---------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258078 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

