Login  Register

How to Force a Link in a Post to Download

classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

How to Force a Link in a Post to Download

SRedrup
I have a Nabble forum on which I want to create Posts with File Links for Downloading.
I am having a problem with Word Document Files (.dotx).
When you click on the link instead of starting a download it attempts to open the file contents in the Browser which is showing as garbled text.

How can I edit the link so that a Download is Forced?

I know you can right click and choose Save Target As but you then have to change the extension (default shows as .html). Although this works, this is a bit too technical and fiddly for the kind of people who use my forum.
Therefore a method to force the download would be much better.

Any help Please?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: How to Force a Link in a Post to Download

GregChapman
Hi,
SRedrup wrote
I have a Nabble forum on which I want to create Posts with File Links for Downloading.
I am having a problem with Word Document Files (.dotx).
This is not really a Nabble question but a general web creation issue and fuller information can be found elsewhere.

How are you creating the link?  The correct procedure for a Nabble forum is to use: More > Upload file.

Once uploaded, this should produce code in the message edit box similar to that below and allows you to edit the text that will appear as the link:
<nabble_a href="myfile.docx">LinkTextToTheDownload</nabble_a>
When you click on such a link in most browsers will send a .docx file direct to the visitors download folder, but it does depend on the operating system and browser used.

The thing to be aware of is that the handling file types that are not native to web browsers is not controllable by the web author. It depends entirely on the operating system and browser used.

The most common form of this question is "How do I get links to PDF files to open in the browser?". The answer is: You Can't! Not only does it depend on the OS and browser but what software and settings the visitor has is his PDF reader software. Some applications force files to load into the reader program itself and have no ability to embed themselves within the browser. This is especially true for those that work on mobile phones as attempting to read documents that will print on Letter or A4 paper become unreadable on a phone screen.

I know you can right click and choose Save Target As but you then have to change the extension (default shows as .html).
Again that feature depends on the visitor's software and settings he has.

It also begs the question about why are you considering publishing .docx files? Is the recipient intended to edit the files? If not then other formats should be considered.If the files are to be edited do you know whether all your visitors have appropriate software. Many, visitors may still only be able handle the .doc format. Others will prefer a non-proprietary format like .odt

Generally, one should not publish files in an (easily) editable format unless you intend the user to edit them. If you are publishing documents designed to be printed then .pdf is a far better format to use. If your documents are not to be printed, but are expected to be read on screen then html is more appropriate. Html is also more appropriate if your visitors are visually impaired as it is likely they will want to have the document read to them with screen reader software and that is probably most easily done within their browser.
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: How to Force a Link in a Post to Download

SRedrup
Hi Greg,

Thank you for your reply, it did help me find a solution.

To try to answer some of your points and to outline my eventual solution (aided by some of your information) I will do it in a bullet point style (probably in no particular order).

. The file was originally uploaded using the "Upload File" option.
. The link was therefore a Nabble Tag.
. I was having the problem with IE11, I found that when I used the Chrome Browser there was no problem
    However, most of my users may use IE and therefore I needed a solution to cover most cases.
. The reason for having a MS Word file is because these are base documents (for Private Forum Members)
   to download and alter for their own organisation.

The solution I found was to save the documents in an older MS Word format with a .DOC extension (instead of the more recent .DOTX extension). As a result both Chrome and IE treat the file as a Download File.

Thanks for the help.

Steve.