.NET Framework Bookmark and Share   
 index > Network Class Library (System.Net) > How can we split and download a file through http request
 

How can we split and download a file through http request

I was trying to download a file through httpwebrequest and the file was quite large. It looks like I am not getting the full content of the file after the download ends. Is there a way to calculate the file size which we are about to download and then split the file into segments and download them all? Later if we merge those segments, we will be getting the whole content of the file.
  • Moved bynobugzMVPWednesday, September 09, 2009 12:07 PM (From:.NET Base Class Library)
  •  
saikat2k06
How are you verifying that you are not getting the whole file in the download?

Are you comparing the #bytes in the "Content-Length" header field, vs #of bytes that you wrote to disk?

Splitting files should not be necessary unless the server is timing out the download.

Also, it would help if you posted a snippet of your code.
feroze
--
My blog
Feroze Daud

You can use google to search for other answers

Custom Search

More Threads

• connecting socket from behind a proxy server
• OleDbCommand.ExecuteReader() Error
• Using IMAP with GMail: A Custom GMail Vacation Auto-Responder
• HTTP Status 417: Expectation Failed
• vb 2008 System.Net.Sockets.TcpClient Connection State
• When I "cancel" a download I cannot .Close() the Stream or the Response for the FtpWebRequest. Suggestions?
• IAsyncResult object exception
• HttpListener
• Problem with FtpWebRequest.GetRequestStream and long filenames
• SMTP sending failure on windows service