hello everyone..i'm trying to get a file in a server using a WebRequest..the server sends some headers saying "Transfer-Encoding :chunked"..what does this basically mean??? I'm using a BinaryReader to read the data..but after some few hundred bytes the transfer just stops..do i have to make a WebRequest again to get the remaining portion of the file??? Please help.

5 Years
Discussion Span
Last Post by thines01

hey thanks for reply..it works this way..one more question, if the server uses UTF-8 encoding,does it apply to the binary data in file transfer too or just the text type??


yeah i get the HTML code..then the transfer stops..but the data i want to retrieve is a stream audio..and I don't know how to access it..could you tell me how to do that??


Did you open a stream?


protected static Stream GetRepsonseStream(string strURI)
         HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(strURI);
         req.ProtocolVersion = HttpVersion.Version10;
         return req.GetResponse().GetResponseStream();

Also, if you did, I saw this post on keeping the sample rate low


yeah and after getting the stream..i'm using a binaryreader to read the stream..

BinaryReader reader = new BinaryReader(dataStream);
byte[] b = new byte[999999];
int index = 0;        
while ((reader.Read(b, index, 2000)) != 0)
    index += 2000;              

my confusion is that..the server is sending HTML codes n stopping the transfer..how do i get an audio stream?? (suppose i'm playing a streaming mp3 file)


well the first video or the 2nd one..anything does just need to know how to do this

This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.