Log in

View Full Version : Hosting .mp3 files



timbim
02-07-2011, 09:36 PM
Hi all,

I'm hosting some mp3 files I want my visitors to be able to download, as well as stream direct. The streaming part I've nailed, I've got a very nice script that embeds a small player. For downloads, I've created an image with a hyperlink to the file. So far so good.

However, if the visitor has quicktime holding their browser to ransom, it takes over and just displays its own streamer interface without the option to download when they click the link. Obviously this isn't ideal, and I can't just ask everyone to get rid of quicktime (although it would be nice if everyone did;))

Is there a way of setting it up that avoids the quicktime problem and forces the browser to download the file directly, preferably without redirecting to a download page?

Many thanks,
Tim

djr33
02-07-2011, 10:52 PM
You cannot actually force a browser to download a file. You simply send it the file (via a hyperlink) and it decides what to do with it: save it, view it (such as with a plugin), or open an external program to via it.

That said, if you google "force download" you will find information about setting the headers for the file (this is a bit complicated) to TRY to force the browser to download it-- basically confuse the browser into saving rather than playing it. But that doesn't always work, and it's not easy.

If you want to guarantee that the file is downloaded, you can place it in a .zip file. It's a little more work (for you and the visitor) but they must download it and it saves bandwidth (a bit).

But since you are streaming anyway, it seems like offering a direct link is fine.

There are two ways that visitors can save the file and you can tell them this:
1. Right click, save as. Works in all browsers (well, almost all).
2. View the file, use quicktime (or whatever) to play it, then choose "file>save". (Most major browsers.)



The short answer to your question is no, you cannot skip quicktime. That's a choice for the browser (and the user), not something you can control from your website. Some ideas to try to modify this are above, but my recommendation is not to try to change the default behavior of a browser. It usually causes more problems than just leaving it as-is.

timbim
02-08-2011, 07:23 AM
Thanks. Thought that might be the case.

Bit of a bugger how quicktime works though.

Tim

djr33
02-08-2011, 10:35 PM
That's your opinion. (Though many may agree with you, and I do sometimes.)
Your visitors might not [all] agree.

If this is about your personal preference, you can certainly disable quicktime on your computer (in your browser's plugin settings).

But others will still have their default experience. If people are complaining to you (unlikely) then you could tell them that they can disable quicktime if they'd like.

I hope that helps. Good luck.