How to get the image size?

M

Mortis the Rigger

What type of image is it, gif, jpg, png etc etc!!!

Details my man, Details!!! :)
 
R

Roland Hall

:
: What type of image is it, gif, jpg, png etc etc!!!
:
: Details my man, Details!!! :)

*snicker*
 
R

Roland Hall

"ËιúÐû" write:
: How to get the image size with VBScript in ASP?

1. Define 'image size'. Do you want width and height or file size?
2. Do you want this from the local drive, i.e. with ASP Upload prior to
upload, or do you want it from an image on the server?

I can get the file size, width, and height either from local or server
without components and without using FSO.
Please advise.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp
 
D

Dan Boylett

I can get the file size, width, and height either from local or server
without components and without using FSO.

How do you manage that then? I would have assumed you'd need to use the FSO
to get information about a file.
 
R

Roland Hall

:
: :
: > I can get the file size, width, and height either from local or server
: > without components and without using FSO.
:
: How do you manage that then? I would have assumed you'd need to use the
FSO
: to get information about a file.

On the server-side you do if it is not an image file. If it is an image
file you can create a new image and set the src to your image file. You
then can use fileSize but there is an issue. When I do it quickly, it
displays -1 for fileSize. If I introduce a delay, it works.

This is one I wrote that allows you to check the file size and image size
(width/height) before you upload. It has a flaw because it will not clear
the file upload text if the file fails validation so I'm using an
alternative method for submitting the form with valid files. I got a
response from HikksNotAtHome about using a dummy form but I have not put in
his method with this code yet.

This is the link for the client-side code:
http://kiddanger.com/lab/iupload.asp

This is the link of the other discussion:
http://groups.google.com/[email protected]#link18
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,142
Messages
2,570,819
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top