Statistics: Posted by Jason Caldwell — March 21st, 2011, 8:14 pm
<a href="http://www.mysite.com/?s2member_file_download=member-subdirectory/product-subdirectory/product-filename.zip&s2member_file_download_key=<?php echo s2member_file_download_key("product-filename"); ?>"><img height="52" width="150" src="http://www.mysite.com/image/image-filename.png" title="Product File Name" alt="" /></a>
Statistics: Posted by adherent — March 19th, 2011, 4:27 pm
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.
<?php echo s2member_file_download_key ("example-file.zip"); ?>
<?php echo s2member_file_download_key ("example-file.zip", "universal"); ?>
Hmm. Can you please post the full code snippet of your link and the call to the s2member_file_download_key() function please?
When logged in as admin in Firefox a key is generated for the advanced download restriction but when clicked returns a 503 ( Invalid Key ) error. Other links on the page appear to work as specified. When I access the download page as a customer without logging in I get the same 503 message.
Statistics: Posted by Jason Caldwell — March 18th, 2011, 7:04 pm
Statistics: Posted by adherent — March 16th, 2011, 11:15 am
By default, s2Member uses your Basic Download Restrictions. However, you can force s2Member to allow file downloads, using an extra query string parameter ( s2member_file_download_key ). A file download `Key` is passed through this parameter, and it tells s2Member to allow the download of a particular file, regardless of Membership Level; and WITHOUT a Customer login being required.
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.
http://localhost/wordpress/?s2member_file_download=example-file.zip&s2member_file_download_key=<?php echo s2member_file_download_key("example-file.zip"); ?>
Statistics: Posted by Jason Caldwell — March 15th, 2011, 8:18 pm
Statistics: Posted by adherent — March 15th, 2011, 11:06 am
Statistics: Posted by Cristián Lávaque — March 14th, 2011, 8:25 pm
Statistics: Posted by adherent — March 14th, 2011, 7:33 pm