PC Review


Reply
Thread Tools Rate Thread

Check Size of Web File Before Downloading it?

 
 
jehugaleahsa@gmail.com
Guest
Posts: n/a
 
      24th Nov 2007
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
 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      24th Nov 2007
Well, the response *may* give you a content-length header, but it may
simply stream, in which case you cannot tell.
 
Reply With Quote
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      24th Nov 2007
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



"(E-Mail Removed)" 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
>

 
Reply With Quote
 
jehugaleahsa@gmail.com
Guest
Posts: n/a
 
      25th Nov 2007
On Nov 24, 4:15 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.com> wrote:
> 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!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get size of file on ftp server before downloading Adam Microsoft Dot NET Framework 2 11th Mar 2010 04:36 AM
code to check file size everytime an Excel file is opened Kaiser Microsoft Excel Programming 2 30th Jul 2006 05:46 PM
downloading/file size terminology =?Utf-8?B?cGhpbC1yZ2UtZWU=?= Windows XP General 18 21st Oct 2005 05:47 PM
Check File Size Poppy Microsoft ASP .NET 1 17th Dec 2003 11:26 AM
Re: check size of file or wether file is emtpy guard Microsoft Windows 2000 CMD Promt 3 7th Oct 2003 02:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:43 AM.