N
nateastle
I have a application that stores a wav file into the database. I
retrieve the wav file through a web service call that gets the file.
When I try to send the file through the response stream it seems the
file gets changed. If I save the file to disk it works properly.
Here is my latest endeavor
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
"test.wav");
BinaryWriter bw = new BinaryWriter(Response.OutputStream);
bw.Write(objPromptStorageOut.promptwave);
bw.Close();
Response.ContentType = ATACUtility.getMimeFromFile
(objPromptStorageOut.promptwave);
Response.End();
The file that gets downloaded is 2 times the size of the original
file.
Here is how I write it to disk
using (BinaryWriter binWriter = new BinaryWriter(File.Open(@"C:
\nater.wav", FileMode.Create)))
{
binWriter.Write(objPromptStorageOut.promptwave);
}
that currently works.
retrieve the wav file through a web service call that gets the file.
When I try to send the file through the response stream it seems the
file gets changed. If I save the file to disk it works properly.
Here is my latest endeavor
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
"test.wav");
BinaryWriter bw = new BinaryWriter(Response.OutputStream);
bw.Write(objPromptStorageOut.promptwave);
bw.Close();
Response.ContentType = ATACUtility.getMimeFromFile
(objPromptStorageOut.promptwave);
Response.End();
The file that gets downloaded is 2 times the size of the original
file.
Here is how I write it to disk
using (BinaryWriter binWriter = new BinaryWriter(File.Open(@"C:
\nater.wav", FileMode.Create)))
{
binWriter.Write(objPromptStorageOut.promptwave);
}
that currently works.