views:

41

answers:

2

i got the mp3 file read as byte[] from the database. how to show this byte[] /assign to which control to make the mp3 load and play in aspx webpage.how to load the mp3 song and display it in webpage???

or. how to download the file????

A: 

There is no built it control that will play an MP3 file. Mostly this is done through flash, and HTML 5 has an audio tag.

If you want to have it downloaded you need to set the correct mime-type before outputting it to the browser.

Oded
A: 

Use a HttpHandler to stream out the byte[] to the browser with the correct mime type in it. There's not a specific control in ASP.NET available out of the box to play this but you can embed simple html in your markup like you would do in an html file to play it in the browser: http://www.google.be/search?aq=f&sourceid=chrome&ie=UTF-8&q=play+mp3+in+html

http://www.google.be/search?sourceid=chrome&ie=UTF-8&q=httphandler+byte[]+mime+type

XIII