I am trying to start the download of an audio file when the user clicks a button using Response.OutputStream. Here is the code I am using:
Response.Clear(); Response.BufferOutput = true; Response.ContentType = "audio/mpeg3"; Response.OutputStream.Write(audioFile.Data, 0, audioFile.Data.Length); Response.Flush(); The problem is that the browser doesn't detect the content type. On mozilla firefox the browser asks me if I want to download mypage.aspx, where mypage.aspx is the page containing this code. Actually what the browser downloads is the audio file but I have to rename it manually to get it working. On IE 6 I get an error saying : An invalid character was found in text content. Error processing resource "mypage.aspx". What is wrong with my code? =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com