|
#1
|
|||
|
|||
|
Please help!!
I've been trying to find a way of force downloading mp3's for an internet radio website and stumbled accross the .htaccess method using: <Files *.mp3> ForceType application/octet-stream Header set Content-Disposition attachment </Files> or simply AddType application/octet-stream mp3 Both seem to work fine for most mp3's but for some strange reason not all of them. I had tried renaming the files that dont work with names that do, to no avail and it is not size dependand as some of the files that don't work are smaller than ones that do. As far as I can tell there is no difference between the files that do and do not work and are all in the same folder. Any ideas anyone....
|
|
#2
|
||||
|
||||
|
You're probably using IE. IE attempts to second-guess the server as to the downloaded file's MIME-type. There is, unfortunately, nothing that can be done about this.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP! |
|
#3
|
|||
|
|||
|
What about using Javascript to force download the file? I've seen examples of this on forums but looks more complicated than the .htaccess method.
|
|
#4
|
||||
|
||||
|
Not possible, I'm afraid.
Your best bet is to compress it somehow (gzip, bzip2, zip).
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP! |
|
#5
|
||||
|
||||
|
so... downloading as opposed to streaming?
Isn't there some way to make it automatically download? Not FORCED download... as in they can still type in the url into the address bar, but it would make it default to downloading. |
|
#6
|
||||
|
||||
|
As I said: compress it.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP! |
|
#7
|
||||
|
||||
|
Sure.
No, I just meant making it open as a download as opposed to a link you can just click and go to. Not sure how to do it... gmail does it with certain filetypes... there's some way, but might be incredibly complex CGI or something, or something more than that. That'll work, though. Yep. |
|
#8
|
|||
|
|||
|
Hmmm, interesting. Care to elaborate?
|
|
#9
|
|||
|
|||
|
Quote:
If IE didn't have a complete disregard for the requirements of RFC 2616 (that is, HTTP/1.1), this wouldn't be an issue (and this is the biggest stumbling block). Simply presenting an application/octet-stream Content-Type header value would produce the download prompt. Allowing the user to configure content handling, like Opera and Firefox permit, would result in an even better solution: send an accurate Content-Type header value and act based on user preferences. I'm afraid there isn't really what you'd consider an adequate solution; trying to force anything on the Web is often a non-starter. Suggestions are about as much as you can hope for, and poor software, like IE, will always limit your options. Mike |
|
#10
|
|||
|
|||
|
I would be happy if I could at least get a dialogue asking the user what they would like to do with the file. There are some instances when you would prefer to stream large mp3's for instance if you just wanted to check out the music without waiting to download but the standard version of Quick Time does not allow you to save the file once it is downloaded.
Any suggestions on how to achieve this? |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|