How do you force a file to download to the user.

How do you force a file to download to the user.

by Clarence Prudhoe -
Number of replies: 4
I can't find any way to force a file to download.

I need to be able to allow users to download a file that is posted in a Forum. This could be a trusted content issue. The Administrator and other trusted users should be able to add a download link to a file in a forum post.

The hyperlink dialog box does not include any selection to force the download of a file.

Also there is no Force Download option available in the URL Resource. And the File Resource only displays a file in the browser.

I tried to add a simple HTML Form Button but the code filter deletes the Action even though I was logged in as Admin and I set Security > Site Policies to allow embedded object tags and enable trusted content. So far, I can't find any to include a file in a forum post that a user can download from the forum.

Thanks
Clarence

Average of ratings: -
In reply to Clarence Prudhoe

Re: How do you force a file to download to the user.

by Rob Johnson -
You can add ?forcedownload=1 to the end of the link. This is especially helpful in preventing IE from opening Office files in the browser. It also works to prevent multimedia files from filtering.

Rob
Average of ratings: Useful (2)
In reply to Rob Johnson

Re: How do you force a file to download to the user.

by Clarence Prudhoe -

Thanks Rob,

Appending ?forcedownload=1 to the URL works great.

I found another way to force the download of a file, but it is not a direct or easy to use as your solution.

If you edit the settings for the File Resource to include Force Download as an option, you can create a File Resource and then copy the link and use it in the forum.

I like your solution best smile

Clarence

In reply to Clarence Prudhoe

Re: How do you force a file to download to the user.

by Rob Johnson -
Credit to Petr Skoda for helping me when I posted a similar question a few years ago. I had template files in Open Office that IE would try to open in the browser. I wanted them to open in OO for students to edit and upload back to me. It was driving me crazy. I am glad it works for you.
In reply to Rob Johnson

Re: How do you force a file to download to the user.

by Adma Lim -
Thnak you~! smile

It also helped me to solve the problem for safari opening up the PDF file in the browser.