Forum Moderators: open

Message Too Old, No Replies

Determin File Size of Remote Image

         

woop01

7:18 pm on Nov 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Our users have the ability to include an image in their profiles by hot linking from the typical free image hosting places. Some users don't realize that 100k images aren't the best for dial up users so we implemented a 'restriction' that images must be below 40k.

Is there a way to determine the file size of a remote image in ASP.NET?

mrMister

5:40 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to do a remote get, using XMLHTTP or something similar. Most servers will output the file size if you do a HEAD request, otherwise, do a full GET request, store it in memory or download it to disk and check the size.

woop01

6:22 pm on Nov 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, I'm not familiar with those processes but I'll see what I can find out. Do you know of any good resources?