User-737643586 posted
hi all am working on an mp3 download asp.net app. after the payment is over the user is presented with a page which has a hyperlink to the mp3 file on the server. when the user clicks on the link, the browser opens the default audio player and plays it. what
i need is the browser to open a 'Save As' dialog. am using an httphandler for validating the file download along with the mp3 request url i append some verification information as querystring inside the httphandler i use the querystring values along with data
from database to validate the download request once validation is successfull i write the mp3 file to the response stream context.Response.WriteFile('requestedfile.mp3') if context.IsClientConnected then 'make changes in the database that shows the download
is successfull end if what my problem is when the user clicks on the link (rather than right click it and select 'Save Target As') the mp3 is played on the client side. once the download is successful, changes are made to the database which reflects a successfull
download. the user haven't saved the mp3 file and he cannot access the file again. is there any http header that forces the browser to open the 'Save As' dialog. i tried changing the content type on the server side as show below. but it's not working. context.Response.ContentType
= "application/exe" i also wants to know whether this method will cause any problem if multiple users tries to download files at the same time which is very much expected. whether i need to use async httphandler. please help
User-1391363652 posted
Try this: Content-Type: audio/mpeg Content-Length: [whatever the right size is] Content-Dis; filename="[your mp3 file name]" Pops up a Save As dialog box every time ;) The only problem with multiple users downloading it is logging it in
the database correctly.