Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open audio files (just run, no save)

Status
Not open for further replies.

bereza

Technical User
Jun 14, 2006
105
EU
Hi everybody,

I am developing a singel home page, authenticated user kan upload audio files and all users (authenticated and not authtenticated) can listen to them.

My problem is when the user clicks on the link (the name of the audio file) gets a window which asks the user if he wants to save or open the file.
what I want to do is when the user clicks on the link it just open the audio file with default media player (realplayer or windows media player or ...) and the user do NOT get the window to save the audio files. (just open and listen not save).

thanks for your help.
I use following code to open the audio files. I use "application/x-unknown" because the files can be .wav, mp3 or .wma or ...


Response.ContentType = "application/x-unknown";
Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + myFile.OriginalName + "\"");
Response.WriteFile(Path.Combine(AppConfiguration.UploadsFolder, myFile.FileUrl));
 
try this instead
Code:
Response.AppendHeader("Content-Disposition", "inline; filename=\"" + myFile.OriginalName + "\"");
this is how i force xls and pdfs to open in the browser instead of prompting for save/open/cancel

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top