cancel
Showing results for 
Search instead for 
Did you mean: 

Make a hyperlink a download

N/A

Make a hyperlink a download

I've got a hyperlink to a Word document on one of my websites (which is built in FrontPage 2000) - I'd like this to download rather than open in a browser when I click on it.

Has anyone got any ideas as to how I can achieve this?

Thanks . . .

Moderators note (John) Title changed from all upper case. This is akin to shouting and is not necessary.
17 REPLIES
Jim
Grafter
Posts: 168
Registered: 30-07-2007

Make a hyperlink a download

I suppose the easiest way would be to zip it up and link to the zip file Smiley
N/A

Make a hyperlink a download

Another way would be to use .htaccess to reassociate .doc's so that the browser downloads it - though I'm not sure this working on the FP server :?
N/A

Make a hyperlink a download

There is a nifty little trick you can use with HTTP headers for this.

First, you would need to restructure any files you have slightly, such that it operates currently.

Any word documents much be in one DIR. It is advised that you have no other files or directories here, as they will be forced to download, instead of showing them inline of the browser.

Call the DIR somthing like "force_downloads"

In this dir, you need a file called ".htaccess" (note the dot at the start).

The only line in this file should read

Header set Content-disposition attachment


This should force most browsers (IE 4 has been known to have problems, and under some cicumstances, so has 5.5) to download the file instead.
N/A

Make a hyperlink a download

Re eurotrains note.

This is true. You would need the downloads hosted on the main webserver.
N/A

Make a hyperlink a download

Thanks, but where do I host them if I host them on the "main webserver"?

Thanks.
Community Veteran
Posts: 6,983
Thanks: 8
Registered: 10-04-2007

Make a hyperlink a download

Put them in a folder located in your htdocs folder.
This is the "root" directory of your web space.
N/A

Make a hyperlink a download

By main server, we mean www.yourusername.plus.com, whereas the FP server is fp.username.plus.com.
N/A

Make a hyperlink a download

I've done this but I get an "Internal Server Error".
N/A

Make a hyperlink a download

It looks like this is disabled in the apache config file.

The only other approach is to look into a CGI relay script.

It would download the file itself, and output the needed headers.

It isn't the easiest thing and I am not aware of any pre-made scripts for it. You would likely need a custom solution.
N/A

Make a hyperlink a download

Thanks very much.

Is it not possible to get PN to enable it on Apache?

If not, how would I get a custom CGI script? It sounds like it costs money?!?!?!?!
N/A

Make a hyperlink a download

PlusNet could enable this, however, I am unsure what else this would enable. There are certain things that providers do not want there user to access, as this could mean trouble including loads placed on the servers.

I will see what I can come up with this afternoon, but there are no promises.

This could cost a lot of money to have made for you, however, the theory isn;t too hard.
N/A

Make a hyperlink a download

OK great. In the meantime I'll ask PN if they can enable this.
N/A

Make a hyperlink a download

On the CGI server (CGI.Username.Plus.Com) I've been able to add MIME types using htaccess (I made the server parse any .testing files as if they were jpgs, so I'm sure it's possible for your use).
N/A

Make a hyperlink a download

I can't get IE to embed any word document in my web browser, so I can't test any of this.

However, you might like to try changing the .htaccess file to have this in

AddType application/octet-stream .doc


Unless I can find out hwo to embed the documents, I have no way to atempt to unembed them Tongue