By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

Check Size of Web File Before Downloading it?

P: n/a
Hello:

Is it possible to request the size of a file given a URL?

I would like to ignore files less than a user-specified value, but I
don't think I should have to download it first, just to find out. Any
help?

Thanks,
Travis
Nov 24 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Well, the response *may* give you a content-length header, but it may
simply stream, in which case you cannot tell.
Nov 24 '07 #2

P: n/a
You can try the HEAD verb. It only retrieves the headers, which may include
the content-length. Here's some detail:
http://www.eggheadcafe.com/tutorials...ead-reque.aspx

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"je**********@gmail.com" wrote:
Hello:

Is it possible to request the size of a file given a URL?

I would like to ignore files less than a user-specified value, but I
don't think I should have to download it first, just to find out. Any
help?

Thanks,
Travis
Nov 24 '07 #3

P: n/a
On Nov 24, 4:15 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
You can try the HEAD verb. It only retrieves the headers, which may include
the content-length. Here's some detail:http://www.eggheadcafe.com/tutorials...1c-4dd8-9129-f...

--Peter
"Inside every large program, there is a small program trying to get out."http://www.eggheadcafe.comhttp://petesbloggerama.blogspot.comhttp://www.blogmetafinder.com

"jehugalea...@gmail.com" wrote:
Hello:
Is it possible to request the size of a file given a URL?
I would like to ignore files less than a user-specified value, but I
don't think I should have to download it first, just to find out. Any
help?
Thanks,
Travis- Hide quoted text -

- Show quoted text -
Oh wow, that cuts some time down (some of the time). Thanks a lot!
Nov 25 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.