.net httpwebrequest determine file size

hi all,

is there a way to determine the size of a file before downloading it with httpwebrequest?

thx
zattzAsked:
Who is Participating?
 
DarkoLordCommented:
You can do the same as with your other question about the content type:

HttpWebRequest  request  = (HttpWebRequest)WebRequest.Create("http://www.something.com");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
int length = response.ContentLength;
0
 
zattzAuthor Commented:
thx:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.