Forum Moderators: coopster

Message Too Old, No Replies

download file popup instead of wmp open

window media player open when click on wma link

         

squallions

7:31 pm on Oct 9, 2004 (gmt 0)

10+ Year Member



hi,

I have a music website and when user click on Download link, it opens window media player and play the file, which i don't want.

Is there a way that when user click on the Download link, it would open a Save As windows allow user to choose: Open, Save ...?

The way I make think user has to click on it. Then it will pull the link from database and put back to header using:

header("Location: " . $file);

File extension is *.wma

Thank you for your help.
sql

jatar_k

7:51 pm on Oct 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe take a look at this method squallions

[webmasterworld.com...]

mikejson

7:49 pm on Oct 10, 2004 (gmt 0)

10+ Year Member



I think there is a way, I can't find the "how" right now but maybe you can look around for it.

I did something similar to this at my work. When I wanted to dispatch a download, I made the content-type that I was returning something to forced the download(I can't remember exactly what it is now :( ). I'll see what I can find on tuesday(canada thanksgiving monday :) ) and post it if I can.

Basically I got it to download the pdf instead of opening it which is Adobe Reader, and IE's default when installed.

I'm pretty sure it's with the content sent in the header. So... If you make the link point to a "dispatching script" and then print out the header to be a "download" and then send the document, it should download.... you'll have to look into it more to find how that works, I can't get to my work machine at this moment :(

jollymcfats

8:31 pm on Oct 10, 2004 (gmt 0)

10+ Year Member



The trick is the
Content-Disposition
header:

header('Content-Disposition: attachment; filename="filename.wma"');

But thanks to a rotating cast of bugs throughout IE's history, it is impossible to guarantee a download action for every visitor using that browser.