Forcing play or download depending on link clicked


#1

Okay, so I am making a sortable table and at the far right column I will have two buttons, one to play an audio clip and another to download it.

As of now, it varies by browser what happens when I click a direct link to the audio clip:

Chrome: Streams through windows media player in the browser
IE 8: Streams through windows media player itself
Firefox: Streams through windows media player in the browser

Not sure about other, but I would assume they are like firefox and chrome.

Anyways what I would like to, is say the user clicks the link in the final column of table to PLAY the clip that it would open the player no matter the browser, but based on the OS, i.e., Windows: Windows Media Player, Mac: iTunes or Quicktime, etc.

Then if they want to download it when the click the download link they would just click the link, and it would bring up the usual browse to save…, etc…

How would I go about doing this?

Also if I was to do this for not only audio clips, but video clips too. Say I have a link to play the Standard Video for dialup or lower speed ISP users, a link to a HD video for high speed users, and a download link (similar to the above for the audio clip).

This is what happens depending on browser when the clip is clicked:
Chrome: Streams through windows media player in the browser for SD and HDs
IE 8: Streams through windows media player itself for both HD and SD videos
Firefox: Begins download for both SD and HD versions

I currently have NOT added the table, but would like to implement it in the near future.

So for the audio I have only one direct link to the file, and the video clip, two, one for SD and one for HD.

I am not sure how secure it would be to just link the file through ftp and make a public user so they could download it, so I did not really want to do this unless it was more secure.

Thanks for your time,

Mike


#2

Anyone?


#3

A quick Google search says you can’t force a download of a file that a browser is configured to open by default. One tip was to create a zip file and link to that.