Open PDF instead of downloading it


Hi Kat.

Did you try adding it to the inline extensions setting? WP Admin > s2Member > Download Options > Inline File Extensions

Let me know if that helped. :slight_smile:

Excellent! - the pdf opens in a new tab now.
Thank you Claveque

btw - do you know how to disable the “confirm download” message that pops up when I click the link to open the PDF?

1 Like

Not sure… I think that’s a browser thing.

Hi again Cristián
No, it must be a S2 Member message, because this is what it says…

Confirm File Download
You’ve downloaded 0 protected files in the last 365 days
You’re entitled to UNLIMITED downloads though,( so no worries).

in both chrome and microsoft edge

Oh, that one. Sorry, I thought you meant another thing.

For that, see: WP Admin > s2Member > Download Options > Shortcode Attributes > skip_confirmation


Thanks again Cristián,
I see the shortcode you are referring to - where would I go to add/edit that?

In the shortcode… You paste the shortcode in the page where you want to have the file URL/link, and add that attribute.

If you use the URL instead of the shortcode, you can pass it in the querystring, e.g.

See also:


Hi Cristián

Really sorry to bother you again, but with regard to confirmation popup…
Do I just paste this code into the general text area in the page content area to prevent the confirmation message from showing when we click on a link to the file eg:
I can’t seem to get the shortcode to work?
[s2File skip_confirmation=“true”]

I thought it would be better to have a short code in the page rather than having to edit every URL, assuming that’s how it works.
Thanks again

1 Like

Yeah - switching of the confirmation box via options globally would be great - especially as I don’t see how you could enter the skip_confirmation=true if you link directly instead of using shortcode.
will not work to add something without resorting to php (so not possible to use editor in html view).

Right now I only see how it works with a shortcode without php:
[s2File download="" skip_confirmation="true" /]

I would actually like to switch that off too - but I have like 10.000 links on my website in the format of:

<li><a href="">Openmtbmap - Italy</a> <span style="color: #808080;"><a style="color: #808080;" href="">(MD5)</a></span></li>

hence I see no easy way to add php stuff - because using an automated search/replace I am pretty sure will break other links too.

If your host has wp cli installed and you have ssh access you can try this. It even has a dry-run command so you can see what it will change before you actually do it.

No I cannot, because there is no regex that would not also destroy other shortcodes/links.

The easiest way to add this to my download links would be using notepad++ for all links on those sites - and then repair all shortcodes which got destroyed. Still quite a lot of work due to all the s2if and language tags on those pages.

I’ve used better search/replace quite a lot - it’s often easier than using direct sql on your database (or using sql commands in phpMyAdmin). I do think it’s better to not resort to [] shortcodes for such an amount of links as I’m pretty sure [] shortcodes cause a lot more PHP calls. That’s also why a global on/off for the download confimation would be nice. Then the shortcode could be used for individual overrides.