latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Jesse Ali

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing topic 1 (of 1 total)
Topic Count Last Reply
Buy Now Buttons 4 Custom Expiring File Links

By:  Arthur Klein in: Community Forum

voices: 3
replies: 3

4 years, 6 months ago  Jesse Ali

Viewing topic 1 (of 1 total)

My Latest Replies (From Various Topics)

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Sunday Jun 17th, 2012 at 12:04 pm #16729
Jesse Ali
Username: JesseAli

Same problem. I have found the download key area just fine… Support points to that area over and over in these forums. I know WHERE the advanced download restrictions are… but it sure would be nice for a better explanation of HOW to use them… because so far, the only thing I can get any of the short codes to produce is non clickable link… it works if I copy and paste the long link with the key into the address bar… but it is not clickable :(

I also would like to be able to make the link say something different or even put it inside of a picture… but none of this is discussed… and in the end… I would just like the link to work…. Please do not send me to the download restrictions area… been there… need help there…

I see all this (it just does not work):

By default, s2Member uses your Basic Download Restrictions, as configured above. However, you can force s2Member to allow File Downloads, using an extra query string parameter: &s2member_file_download_key=[Key]. A File Download `Key` is passed through this parameter; it tells s2Member to allow the download of this particular file, regardless of Membership Level; and WITHOUT checking any Basic Restrictions, that you may or may not have configured above. The creation of a File Download `Key`, requires a small PHP code snippet. In order to use PHP scripting inside your Posts/Pages, you’ll need to install this handy plugin ( PHP Execution ). There is also a Shortcode equivalent, which does NOT require PHP at all, as seen below.

http://??????????????/?s2member_file_download=example-file.zip&s2member_file_download_key=
s2member_file_download_key =

http://###########/?s2member_file_download=example-file.zip&s2member_file_download_key=s2Key file_download="example-file.zip" /]
Shortcode equivalent: [s2Key file_download="example-file.zip" /]

[s2File download="example-file.zip" download_key="true" /] ( Key is auto-generated in this case )
Shortcode equivalent: [s2File /] produces the entire URL, no need to generate a Key yourself.

The function s2member_file_download_key(), is part of the s2Member API. It produces a time-sensitive File Download Key that is unique to each and every visitor. Each Key it produces ( at the time it is produced ), will be valid for the current day, and only for a specific IP address and User-Agent string; as detected by s2Member. This makes it possible for you to create links on your site, which provide access to protected file downloads; and without having to worry about one visitor sharing their link with another. So let’s take a quick look at what s2member_file_download_key() actually produces.

s2member_file_download_key(“example-file.zip”) = a site-specific hash of: date(“Y-m-d”).$_SERVER[“REMOTE_ADDR”].$_SERVER[“HTTP_USER_AGENT”].$file

When s2member_file_download_key = a valid Key, it works independently from Member Level Access. That is, a visitor does NOT have to be logged in to receive access; they just need a valid Key. Using this advanced technique, you could extend s2Member’s file protection routines, or even combine them with Specific Post/Page Access, and more. The possibilities are limitless really.

Viewing 1 replies (of 1 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.