RicksAtWork
Programmer
I am trying to send an mp3 to a browser. However, it takes about 20 seconds before anything appears, and then file appears all of a sudden in blocks.
How can I make teh app so the response is sent immediately in chunks?
This is my code so far:
FileStream oFile = new FileStream(context.Server.MapPath("~") + "/Audio/UploadedAudio/" + filename, FileMode.Open);
objResponse.Charset = "";
objResponse.ContentType = "audio/mpeg3";
BinaryReader br = new BinaryReader(oFile);
for (long l = 0; l < oFile.Length; l++)
{
objResponse.OutputStream.WriteByte(br.ReadByte());
}
oFile.Close();
How can I make teh app so the response is sent immediately in chunks?
This is my code so far:
FileStream oFile = new FileStream(context.Server.MapPath("~") + "/Audio/UploadedAudio/" + filename, FileMode.Open);
objResponse.Charset = "";
objResponse.ContentType = "audio/mpeg3";
BinaryReader br = new BinaryReader(oFile);
for (long l = 0; l < oFile.Length; l++)
{
objResponse.OutputStream.WriteByte(br.ReadByte());
}
oFile.Close();