How to play Telerik RadCaptcha WAV file without open / save dialog

I have a link on my page allowing the user to listen to the conversion code, clicking the link will open an open / save dialog. If possible, I would like the browser to just play the file and not require user interaction.

This is how I get the audio back to the browser:

byte[] filebytes = Helper.TextToAudioBytes(code);
Response.AddHeader("Content-Disposition", "attachment; filename=sound.wav");
return File(filebytes, "audio/wav");

      

+3


source to share


1 answer


You are sending a Content-Disposition header with a value attachment. This tells the browser that the file should be saved and not processed like normal content. Deleting this file will allow the browser to process the file according to the browser settings.



Note that the browser settings may still "save the file" or no matter what the user chooses, it is not necessary to "play sound".

+2


source







All Articles