Hi Perry. Absolutely.
There are no dense questions here.
~ It's all good.
So let's say you have
eBook.pdfYou upload that file here:
/wp-content/plugins/s2member-files
/eBook.pdfOk, so now the file is
protected by s2Member.
So now, from your WP Dashboard, go to:
s2Member ->
Download Options -> Inline Extensions
and type "pdf" into the Inline Extensions field.
You now have two choices in how you provide access to this file.
1. You can let s2Member's configuration take care of everything. You configure
Download Restrictions in your WP Dashboard, by navigating to: s2Member ->
Download Options ->
Protected File Downloads. You can configure which Levels have access, and how many files they're allowed to
download in any given period of time. In this case, you would just link to the file on your site, anywhere, without concern for link sharing, because a Member
has to be logged in to gain access.
- Code: Select all
http://www.yoursite.com/?s2member_file_download=eBook.pdf
s2member_file_download = location of the file, relative to the /s2member-files/ directory.
In other words, just the file name itself, and that's it.
2. You can use Advanced
Download Keys.
In this case, you need to have the
Exec-PHP plugin installed, or have access to your WP theme files. One or the other; because you need to use a PHP tag in order to generate the encrypted ( time sensitive )
Download Key that is unique to each and every Internet User. In this example, we're using the s2Member API function, called "
s2member_file_download_key()".
- Code: Select all
http://www.yoursite.com/?s2member_file_download=eBook.pdf&s2member_file_download_key=<?php echo s2member_file_download_key("eBook.pdf"); ?>
So, in your case; a real world example, might be the following.
You sell Specific Post/
Page Access to Post ID# 121, titled: "My Special eBook".
You install the Exec-PHP plugin, and in the content for this
protected Post ( Post ID #121 ), you add a link that reads "
Download My eBook", and it looks like this in the HTML tab of your WordPress Editor.
- Code: Select all
<a href="http://www.yoursite.com/?s2member_file_download=eBook.pdf&s2member_file_download_key=<?php echo s2member_file_download_key("eBook.pdf"); ?>">Download My eBook</a>
To summarize:The only way a visitor can gain access to this
Download Link with a Key in it, is if they purchased Access to Post ID #121. Once a visitor gains access to this
protected Post, a special
Download Link is automatically generated specifically for them, and it cannot be shared. The
download link is also time-sensitive.
How come the link can't be shared?Because
s2member_file_download_key ("eBook.pdf") =
an installation-specific hash of s2member_xencrypt(date("Y-m-d") . $_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] . $file)There are many other ways in which
Download Key's could be used/generated, but this is one example that I think best applies to your situation. Let me know if anything is unclear. ~Thanks.