Click to See Complete Forum and Search --> : determine file size (in bytes)


aagha
02-10-2003, 11:16 AM
I'm working within a JSP where I'm being sent a series of URL paths to images to display on a page. Somtimes, and without being able to tell based on the URL, the image passed to me is a blank image, of 902 bytes.

Is there a way for me, in JavaScript, to determine the size of an image if all I have is a URI to that image?

khalidali63
02-10-2003, 12:50 PM
No.
JavaScript does not have the ability to do such a thing.
Since you are using jsp,you can use the
HttpServletRequest.getInputStream().length();

method to get the total size in bytes of any url data or just look at the methods of the HttpServletRequest you will find a way.

cheers

Khalid