Writing MP3 file to browser from aspx page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone have any good way to write an mp3 file to the browser directly from an aspx page? I tried the same logic as returning any other binary file but it does not seem to work. Here is what i used:

Response.ContentType = "audio/x-mpeg"
Response.WriteFile(sPath)
Response.End()

When media player comes up it says i cannot download from the server. If I try to right-click the link that calls this page, it says internet explorer cannot find the file. Any ideas?
 
Hi Jason,

Did you try this also as a question in the newsgroup

Adonet
<
Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes
..asp?icp=msdn&slcid=us&newsgroup=microsoft.public.dotnet.framework.aspnet>

I hope this helps,

Cor
Does anyone have any good way to write an mp3 file to the browser directly
from an aspx page? I tried the same logic as returning any other binary file
but it does not seem to work. Here is what i used:
Response.ContentType = "audio/x-mpeg"
Response.WriteFile(sPath)
Response.End()

When media player comes up it says i cannot download from the server. If I
try to right-click the link that calls this page, it says internet explorer
cannot find the file. Any ideas?
 
Back
Top