typemill / typemill

Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible website and eBook creation using Markdown.
https://typemill.net
MIT License
427 stars 60 forks source link

Ebook Products Download Links opens in new tab instead of downloading #316

Closed MysterieDev closed 2 years ago

MysterieDev commented 2 years ago

Hey. I tried your ebookproducts plugin.

It is also usable as a pdf-download-shortcode.

i tried downloading my PDF, which is a pdf-ppt. It did not download, but open the file in a new tab.

I think using the download Attribute https://www.w3schools.com/TAGS/att_a_download.asp helps to solve this issue!

MysterieDev commented 2 years ago

image this should help

MysterieDev commented 2 years ago

https://github.com/typemill-resources/ebookproducts/pull/1 created a pr

trendschau commented 2 years ago

Great, thank you! I will check it this week and merge all pr's.

Which browser and OS do you use and did you use the actual htaccess? Because all downloads should go through a php class that checks the rights and maybe I have to improve that, too.

The htaccess should contain:

RewriteRule ^(system|content|data|settings|(media\/files\/)) index.php [QSA,L]
MysterieDev commented 2 years ago

@trendschau that was not a problem of rights. I wanted to download the file, but it kept opening it in a new tab, which took its time depending on the filesize.

You could also make this a setting. For example: target="_blank" --> open in new tab download --> download on the spot

i also checked the rights on the download. I expected the direct download to be accesible but you did a good job there and i could only access it with the given rights!

trendschau commented 2 years ago

ok thank you, will try to check everything this evening. Do you want access to ebookproducts and ebook plugin?

MysterieDev commented 2 years ago

@trendschau I think it's enough using the forks to create prs right now, first time doing it this way, but github integration for that seems neat. Right now, i think i have sufficient rights to contribute. I'd ask for access if i got a bigger change coming in.

MysterieDev commented 2 years ago

If you want the prs to go against the develop branch of your plugins, then i need rights!

trendschau commented 2 years ago

thank you, I merged and published it