How to force a link to download a file instead of opening it on the browser?

Neus

New Member
#1
Hello,
On my website I have a button to download my book in EPUB format. You can see it here: https://imwithlorac.com/get-the-book/#downloads
In the other browsers the file is downloaded, but in Mozilla it opens directly in the browser and unless you have installed in Mozilla an EPUB reader, a page with the raw file opens which does not make any sense. It's the same with the MOBI format. On the other hand, with the PDF format the PDF book opens because Mozilla can open PDF files.
What I want is that it doesn't open, but that it downloads when people click on the link.
I've done this: https://www.rtcom.me/epub-e-mobi-su-wordpress/ I've purged the LiteSpeed cache and still doesn't work.
Any ideas?
Thanks.
 
Last edited:

Pong

Administrator
Staff member
#2
It is not something from server end, but only a setting from your firefox browser,
https://prnt.sc/u15xto
basically you can choose save file or open with, if you have some previous incorrect setting as open with, you should clear it. you can google it yourself for firefox.
 

Neus

New Member
#3
This is a link for my readers to download the book, so I would want that when they click on the link, the file downloads directly, without them changing the settings of Firefox. Thank you.
 

Neus

New Member
#5
Solved!
I had the files in a subdomain. I took them out of there and put them in a folder. It's been working ever since. Now in Firefox a popup window opens asking you if you want to open the file or save it.
Thank you.
 
Top