I have read several threads in this forum today regarding forcing a browser to download an mp3 file instead of trying to play it.
I have created a .htaccess file and placed it in a folder along with the relevant mp3 files.
I’m not sure that I have the code correct in the file ?
My code is =
<Files Mud Music 1.mp3> ForceType application/binary
Also, in freeway, when providing the link to the files, should I select File, Http or FTP.
Also, should my link give the full address or just the relative link?
Any help would be appreciated as this has taken me 6 hours so far without success.
You might want to make sure that all your filenames have no spaces in
them. Replace those with underscores or dashes. Most things in Unix
(which tends to be the underpinnings of the Web in general) do not
relate well to spaces in filenames.
Also, try using FilesMatch *.mp3 instead, since the asterisk acts as a
wildcard and that way you don’t have to type out each filename. Close
the command with
Where are you seeing the option to choose File, Http or FTP?
Walter
On Mar 8, 2010, at 10:00 AM, Neil wrote:
Hi All,
I have read several threads in this forum today regarding forcing a
browser to download an mp3 file instead of trying to play it.
I have created a .htaccess file and placed it in a folder along with
the relevant mp3 files.
I’m not sure that I have the code correct in the file ?
My code is =
<Files Mud Music 1.mp3> ForceType application/binary
Also, in freeway, when providing the link to the files, should I
select File, Http or FTP.
Also, should my link give the full address or just the relative link?
Any help would be appreciated as this has taken me 6 hours so far
without success.
I would leave the protocol out of it altogether. Just make a relative
link to the file. So if you are on a page outside of the files folder,
like this:
somefolder/
a_page.html <-- you are here
files/
.htaccess
one.mp3
two.mp3
Then you would use the External side of the Hyperlink dialog, and enter
files/one.mp3
as the only text in that dialog.
This makes your site portable, since it doesn’t rely on any part of
the URL being one thing or another. The server will fill in the blanks
for you.
Walter
On Mar 8, 2010, at 11:33 AM, Neil wrote:
Hi Walter,
Thanks for the fast response.
I am seeing the File, Http and FTP options when I create a hyperlink
to the folder containing the mp3s.
That means that either there is a typo in the .htaccess file, or your
server is not set up to allow you to make these changes through
the .htaccess mechanism. Copy all the text out of your .htaccess file,
and paste it at Pastie.org. Post the URL that Pastie gives you back
here. Perhaps something is getting lost in translation.
Walter
On Mar 8, 2010, at 11:59 AM, Neil wrote:
Hi again,
I think I have managed to do as you suggested.
I now get a “Internal Server Error” message?
Ok, If I remove the .htaccess file from my download folder, when I click my hyperlink, I am directed to the correct file but it starts to play.
At least this shows that my links to the file are correct.
However, if I add in your updated version or my original version of the .htaccess file, I get the error message again.
I have just had a frustrating ‘Live Chat’ with the people from Eukhost support and all they did was rename my .htaccess file so that the mp3 would play and then disconnected the chat !
Sorry, without the help of your hosting provider, this won’t work
correctly. Your host needs to enable the AllowOverrides = All property
in your Apache configuration file, and until they do, this is just
doomed. I have tested it on my server, and so I can say with certainty
that it works.
Walter
On Mar 8, 2010, at 3:03 PM, Neil wrote:
Hi Walter.
Ok, If I remove the .htaccess file from my download folder, when I
click my hyperlink, I am directed to the correct file but it starts
to play.
At least this shows that my links to the file are correct.
However, if I add in your updated version or my original version of
the .htaccess file, I get the error message again.
I have just had a frustrating ‘Live Chat’ with the people from
Eukhost support and all they did was rename my .htaccess file so
that the mp3 would play and then disconnected the chat !
If you make this level of change, then no MP3 will ever play on your
entire server. The key is to have the ability to set the server to
respond differently in different folders, hence the .htaccess file.
(Despite the name, .htaccess can be used for way more than access
control under Apache.)
Walter
On Mar 8, 2010, at 3:49 PM, Neil wrote:
Is something I could do with Apache Handlers?
I can see a menu item called Apache Handlers and it asks me for -
Handler
Extension
Is this it, if so, have you any idea of the format required?
I have had communications with my hosting provider. At first they claimed that this was enabled. Then they said that they had just enabled it.
Still it does not work. They said that they can see errors in the .htaccess code?
I’ve pasted the error message they gave me no. 860272
This is because you used TextEdit to make it. If you do that, you must
must must set TE to Plain Text mode. (Format / Make Plain Text)
For the low, low, price of Free, you might want to get a copy of
TextWrangler at http://barebones.com and use it for all your extra-
Freeway Web activities. It’s the baby brother of the original Mac
programmer’s editor: BBEdit. It won’t mangle your code or add anything
hidden to it.
Walter
On Mar 8, 2010, at 4:54 PM, Neil wrote:
I have just logged in to my control panel.
I opened the .htaccess file using the control panel editor and it
looks like :