[Pro] Mp3 Download

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.

Thanks very much.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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.

Thanks very much.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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.

Thanks


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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.

Thanks


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi again,

I think I have managed to do as you suggested.
I now get a “Internal Server Error” message?

Any ideas


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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?

Any ideas


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I had never heard of Pastie.Org. What a great facility !

It’s amazing what other tips I pick up when posting on hear !

http://pastie.org/859833


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry that should be here …not hear !


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try this one. A slight adjustment to the regular expression syntax,
and also put things on three lines:

http://pastie.org/859852

Walter

On Mar 8, 2010, at 12:21 PM, Neil wrote:

I had never heard of Pastie.Org. What a great facility !

It’s amazing what other tips I pick up when posting on hear !

http://pastie.org/859833


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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 !

Have you any other ideas I could try?

Thanks again,
Neil


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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 !

Have you any other ideas I could try?

Thanks again,
Neil


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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?

Thanks ever so much for your help with this.

Neil


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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?

Thanks ever so much for your help with this.

Neil


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi again,

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


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

So could Neil just Zip the MP3s he wants to have download?

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

And it works on my server too…

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry, I should have said, www.Pastie.org No. 860272


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I have just logged in to my control panel.
I opened the .htaccess file using the control panel editor and it looks like :


{rtf1ansiansicpg1252cocoartf1038cocoasubrtf250
{fonttblf0fnilfcharset0 Monaco;}
{colortbl;red255green255blue255;}
paperw11900paperh16840margl1440margr1440vieww9000viewh8400viewkind0
pardtx560tx1120tx1680tx2240tx2800tx3360tx3920tx4480tx5040tx5600tx6160tx6720qlqnaturalpardirnatural

f0fs24 cf0 <FilesMatch “.mp3*”>
ForceType application/binary
}

Obviously much more in here than the file I uploaded !!!

This must be the problem as much of this is the text that appears in the error message.

I will re-edit using the control panel editor and try it again .


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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 :


{rtf1ansiansicpg1252cocoartf1038cocoasubrtf250
{fonttblf0fnilfcharset0 Monaco;}
{colortbl;red255green255blue255;}
paperw11900
paperh16840margl1440margr1440vieww9000viewh8400viewkind0
pard
tx560
tx1120
tx1680
tx2240tx2800tx3360tx3920tx4480tx5040tx5600tx6160tx6720ql
qnaturalpardirnatural

f0fs24 cf0 <FilesMatch “.mp3*”>
ForceType application/binary
}

Obviously much more in here than the file I uploaded !!!

This must be the problem as much of this is the text that appears in
the error message.

I will re-edit using the control panel editor and try it again .


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi both,

It worked !!! Hooray !!!

I am using :-

<FilesMatch “.mp3$”>
ForceType application/binary

The additional code in my earlier post seemed to be the styling of the information from Walters post ?

Why would it appear like that when viewed by the server?

Anyway, it works now and I’m very greatful for your help.

I’ve been at this since 9am. = 12 hrs 58 mins.

Thanks so much for your help.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options