Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image size

Status
Not open for further replies.

chrisparr21681

Programmer
Nov 18, 2002
17
GB
i need to check that images are being uploaded through a content management module at a certain size, if they exceed the 10k or are not 120x120 then i want an error message to popup
 

Certainly, in IE at least, you can create a new image object, assign the source, and then query the width and height attributes... I'm not sure how well this works in other browsers, but give it a go anyway.

Having said that, you cannot check the filesize client-side (without using an IE-specific activeX control)... So you'd be far better off doing this whole thing server-side. And you must have access to server-side scripting to be writing your CMS anyway, I would have thought.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top