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.

S3 File Downloads

Home Forums Community Forum S3 File Downloads

Tagged: 

This topic contains 47 replies, has 3 voices. Last updated by  Andrew Hodges 3 years, 5 months ago.

Topic Author Topic
Posted: Thursday May 2nd, 2013 at 6:27 pm #49049

I am confused and it is possible I have not seen some documentation here but it is not through lack of trying.

I have installed S3 (or joined) followed your documentation re combining it with s2 (
JW Player® w/ s2Stream Shortcodes (S3/CloudFront)) which was quick easy and worked well. I have only 2 membership levels on my site 0 and 1 and the inline video works fine.

But

Then I wanted to store videos on S3 that I wanted people with 0 to see and …. I can’t see how. How do I set some to 0 and some to 1. I have of course changed the page meta data and even just put in on page but no joy.

Plus I want to download pdf’s and can’t see the documentation for that. I have guessed from some posts here it should look like this

href="http://fernleafconsulting.co.uk/?s2member_file_download=s3-eu-west-1.amazonaws.com/fernleaf/CodeCanyon.pdf"

which creates this (which looks like it could be sensible) but it just pops up my limit download message then redirects me to my Members Options Page having logged me out. I was logged in as administrator but have tried my test users 0 and 1 as well.

https://fernleafconsulting.co.uk/FLWP/membership-options/?_s2member_seeking%5Btype%5D=file&_s2member_seeking%5Bfile%5D=s3-eu-west-1.amazonaws.com%2Ffernleaf%2FCodeCanyon.pdf&_s2member_seeking%5B_uri%5D=Lz9zMm1lbWJlcl9maWxlX2Rvd25sb2FkPXMzLWV1LXdlc3QtMS5hbWF6b25hd3MuY29tL2ZVDYW55b24rSW52b2ljZS5wZGY%3D&_s2member_req%5Btype%5D=level&_s2member_req%5Blevel%5D=1&_s2member_res%5Btype%5D=file&s2member_seeking=file-s3-eu-west-1.amazonaws.com%2Ffernleaf%2FCodeCanyon.pdf&s2member_level_req=1&s2-ssl=yes

(I have altered the key and file name because we are posting in public.)

Would you tell me what I am doing wrong and point me in the direction of the documentation.

List Of Topic Replies

Viewing 25 replies - 1 through 25 (of 47 total)
Author Replies
Author Replies
Posted: Friday May 3rd, 2013 at 2:35 am #49089

http://fernleafconsulting.co.uk/?s2member_file_download=s3-eu-west-1.amazonaws.com/fernleaf/CodeCanyon.pdf

Just enter the filename, not the S3 address. s2Member will create the S3 URL based on the filename and your Amazon settings in the Download Options page.

http://fernleafconsulting.co.uk/?s2member_file_download=CodeCanyon.pdf

Then I wanted to store videos on S3 that I wanted people with 0 to see and …. I can’t see how. How do I set some to 0 and some to 1.

See the documentation here, please: [hilite path]Dashboard -› s2Member® -› API / Scripting -› Custom Capability and Member Level Files[/hilite]

Posted: Friday May 3rd, 2013 at 5:32 am #49108

Thanks for the prompt reply but I had tried that and I get the same result. To be certain I tried it again before replying and it redirects me to the members options page>

Any thoughts the rest of s2member seems to be behaving as expected.

Thanks also for the fact sheet.

Posted: Friday May 3rd, 2013 at 5:21 pm #49144

To be certain I tried it again before replying and it redirects me to the members options page

If you’re not logged in, you will be sent to the Membership Options page, since it’s a protected file. If you’re logged in to your admin account, you would not be redirected, since s2Member restrictions don’t apply to administrators.

Posted: Friday May 3rd, 2013 at 5:46 pm #49148

Yes correct.

You misunderstand me. I am logged in (I have to be to see the download page). It does not matter as who because the result is the same.

Once I click on the link it tries to connect then fails and redirects me to the members option page where I find myself logged out.

The wrong behaviour.

Posted: Saturday May 4th, 2013 at 2:34 am #49191
Bruce
Username: Bruce
Staff Member

Once I click on the link it tries to connect then fails and redirects me to the members option page where I find myself logged out.

So s2Member is logging you out when you attempt to access a file? It sounds to me like a conflict with your domain set up. Looking at your URLs, the one you’re linking to the file with begins with fernleafconsulting.co.uk, while your main site resides at fernleafconsulting.co.uk/FLWP/. It looks similar to a don’t mix www and without situation to me. I have been unable to reproduce this issue in my testing environment.

Can you try accessing your file download with this link instead, please?

http://fernleafconsulting.co.uk/FLWP/wp-content/plugins/s2member-files/fernleaf/CodeCanyon.pdf

This link is using the Advanced Mod-Rewrite Linkage gone over here in your Dashboard:

Dashboard -› s2Member® -› Download Options -› Advanced Mod-Rewrite Linkage

Posted: Saturday May 4th, 2013 at 6:08 am #49197

Interesting.

I have tried your link and it certainly got different behaviour. The error is printed below. I also tried some other mod links including -s3 which gave me a 404

Error

<Error>
<Kode‹>NoSuchKey</Kode>
<Message>The specified key does not exist.</Message>
<Key>fernleaf/CodeCanyonInvoice.pdf</Key>
<RequestId>A6C91CC386D809FD</RequestId>
<HostId>
+vfNKBTBxazpISmQBzlS+G62a7pNz6BfgrFYGf6JaMfGPYzdffdfrb9kuZrcq/SO
</HostId>
</Error>

You will see the full file name in the xml (I have changed the element to (Kode) as it was interfering with the editor here).

I have checked the keys and they are correct. The videos from the same bucket are downloading (in-line) I have checked the file name on S3 cutting and pasting it into the string.

Finally, and with some interest, I see that the count of files down loaded while I have been trying different paths, has gone to 4. Yet as far as I am concerned there is no file?

I understand how difficult it is to advise without being able to replicate the error if you want to have my test log-ins I will supply them by an e-mail if that will help.

Posted: Saturday May 4th, 2013 at 1:16 pm #49208
Bruce
Username: Bruce
Staff Member

Thanks for the follow-up.

I have tried your link and it certainly got different behaviour. The error is printed below. I also tried some other mod links including -s3 which gave me a 404

If you’d getting an error like this it means that s2Member did connect to Amazon and is attempting to read the file normally, so my suspicions were correct in this regard. However it appears that now you have another problem with your keys.

Note that adding the bucket name to the URL is not needed, because you’re only setting up one bucket and s2Member automatically checks the bucket you have set up, so you just need to use the regular linkage.

Finally, and with some interest, I see that the count of files down loaded while I have been trying different paths, has gone to 4. Yet as far as I am concerned there is no file?

That’s to be expected. s2Member is checking to see if the User has access, and then draining the count on that account and sending them to Amazon’s servers. s2Member can’t tell if Amazon is failing of not. I’m recommend changing your settings to allow unlimited downloads while we’re testing.

See: Dashboard -› s2Member® -› Download Options -› Basic Download Restrictions


Based on what I’ve read on the NoSuchKey error, as you have, this is a 404 error, so either you have your bucket name wrong, your bucket’s name is invalid (should be all lower case), or there is a network problem that’s causing a 404 somewhere.

Are you using Cloudfront CDN as well?

I’d recommend first wiping your integration clean using the information here:

Knowledge Base » Reset the Amazon S3/CloudFront integration

Then, set your bucket back up in the Dashboard. If you’re using Cloudfront CDN, don’t set that up yet. Just set up a standard S3 Bucket and test a file there. If that still does not work, please send us a Dashboard Login and we’ll take a look at the logs for the connection.

See: Dashboard -› s2Member® -› Download Options -› Amazon® S3/CDN Storage

You can send a Dashboard login here: s2Member® » Private Contact Form

Posted: Friday May 10th, 2013 at 10:27 am #49691

Thanks for the reply. I have been away but will try your suggestions and revert back to you..

Posted: Saturday May 11th, 2013 at 7:14 am #49733

I have tried your suggestion and redeployed the keys after running your function. I now cannot see either video or the downloaded file?

I have tried this now on my local dev server and it does not work there either. I have updated the dev server with latest php release and rolled it back to no joy.

I can accept I am doing something fundamentally wrong but I can’t see what that is. I have sent you a login to the main site.

Posted: Saturday May 11th, 2013 at 1:15 pm #49749

Sorry it would have been useful to give you the video error

Parse error: syntax error, unexpected ',' in /home/content/97/8351397/html/fernleaf/FLWP/wp-content/plugins/s2member/includes/classes/sc-files-in.inc.php on line 154

File:

http://fernleafconsulting.co.uk/FLWP/portfolio-view/human-resources-add-new-user/

Posted: Monday May 13th, 2013 at 3:19 pm #49840
Bruce
Username: Bruce
Staff Member

Thanks for the follow-up.

What version of s2Member are you currently running?

Posted: Tuesday May 14th, 2013 at 6:58 pm #49974

current one as of the date of my mail. Just run 13/05/13 and the syntax error has gone. However I still have no video and no down loads. (the videos were working you’ll remember) The error message on the down load in Chrome is 404: Sorry, file not found. Please contact Support for assistance.

As I have said I have cut and pasted the file name and bucket name (lower case) directly from S3.

Posted: Thursday May 16th, 2013 at 10:25 am #50074

Have you had a chance to look at this?

Posted: Friday May 17th, 2013 at 4:10 am #50099
Bruce
Username: Bruce
Staff Member

I received details through the Private Contact From, but when I try to navigate to log in to your site, I’m getting prompted with a 404 message. This is the URL I’m using:

https://fernleafconsulting.co.uk/wp-login.php

Where can I log in to see your setup?

Posted: Friday May 17th, 2013 at 4:31 am #50102

Sorry there have been a number of bot attacks recently and I have bolstered the security around common links. You could use the login link at the bottom left hand corner of the home page (in the footer above the leaf image) http://fernleafconsulting.co.uk.

Posted: Monday May 20th, 2013 at 12:38 pm #50229

Sorry to chase you but I raised this issue on the 2 May and we still have not got a resolution.

When I bought the product one attraction was it came with support so would you please let me know where we are with the problem. I have not changed anything myself because I did not want to interfere with your efforts.

Posted: Tuesday May 21st, 2013 at 4:19 am #50257
Bruce
Username: Bruce
Staff Member

Very sorry for the delay in response.

Thank you for your patience.

Sorry there have been a number of bot attacks recently and I have bolstered the security around common links. You could use the login link at the bottom left hand corner of the home page (in the footer above the leaf image) http://fernleafconsulting.co.uk.

Okay, I tried logging in and I got this screen:

I’m seeing here the when you access http://fernleafconsulting.co.uk, you are redirected to http://fernleafconsulting.co.uk/FLWP/. I’m at a loss to why this is happening, but I can tell you that this is causing the errors in whatever way you have this set up. I see that when I click on your login link you have your redirect_to variable set up to be /FLWP/…, which means that your WordPress site URL is actually set up to be on http://fernleafconsulting.co.uk/, but it’s using some hacky ways to keep the site over on the /FLWP/ subdirectory.

At this point I really can’t diagnose your site until you get this problem sorted out and either get your site moved over to your subdirectory, or to the main site to where we can look at the logs and see what exactly s2Member is attempting to connect to.

At this point I’m forseeing a massive log file full of errors from s2Member attempting to connect to your site and getting 404s due to the way you have your site redirecting over to your subdirectory. Please sort this out, and let us know when this is fixed and we will then diagnose your issues, if they still exist.

Posted: Tuesday May 21st, 2013 at 5:46 am #50280

Hi,

I assume that you have not logged in to the fernleaf directory with ftp.

There is nothing unusual in the set up here. This is hosted by Godaddy and fernleafconsulting.co.uk resolves to the root fernleaf (a directory) WordPress is then installed on a subdirectory FLWP and the standard WP installation is used for FLWP with index.php in the root (fernleaf) redirecting to FLWP (sub directory) using

require('./FLWP/wp-blog-header.php');

nothing unusual about it. http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

The login page is yours with a different banner
First time you login you do not get the error frame at the top – you must have logged in incorrectly
s2member has performed well up until this point with no errors for redirects etc
All of the paypal forms are performing as they should when tested in sandbox mode
The video downloads were working happily at the first install of the S3 keys
No where in your documentation does it say the site should not be installed in a sub-directory

The ftp details I have given you give access to the whole virtual directory which if you have looked may have confused you, my fault, I am sorry, but if you were to look at the DNS records you will see that the install for fernleafconsulting.co.uk is standard. Resolving to /fernleaf installed in /fernleaf/FLWP no hacks nothing out of the ordinary. There must be thousands of sites installed like this on Godaddy and other hosts.

Maybe you would come back to me.

Posted: Tuesday May 21st, 2013 at 1:36 pm #50299

I have had a further look at this myself. I had not wanted to change things if you were playing with it but in the light of your last post I thought I might as well.

I have reinstalled the keys

Amazon® CloudFront Distributions auto-configured successfully. Please allow 30 minutes for propagation.

and

Your Amazon® CloudFront Distributions are: ( ALREADY configured! )

I have got somewhere with the video since configuring CloudFront and that has worked. If you are logged in you can see that work at http://fernleafconsulting.co.uk/FLWP/portfolio-view/human-resources-add-new-user/ .At the moment I can connect to S3 but I am not getting the download.

Down loaded files appear to have this problem.

The server at d32m2blufyd7ia.cloudfront.net can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.

which waffle aside seems to say we are not delivering the correct key?

I have reconfigured the s2member settings again and I am back to having the video working but pdf downloads failing. As the video works I am reluctant to believe this is an addressing issue or routing caused by the installation. Same error as in the post Saturday May 4th, 2013 @ 6:08 am.

Finally, as I have looked through all of this, I have also kept an eye on the error logs (at least those I can find) and I can see no record of errors in relation to redirects or 404’s. Largest file is only 590,216 bytes – not massive.

So where do we go from here?

Posted: Thursday May 23rd, 2013 at 4:03 pm #50451

Andrew, I tried to login with the credentials you sent, but every time I tried to load /FPWP/wp-login.php or /FPWP/wp-admin/ I got sent to /FLWP/not_found. I’m guessing something in your installation is causing it, maybe you added a redirection in your htaccess?

Also, I see that you still have the Amazon reset hack in your must-use plugins, I’d remove it so no one can cause you trouble with it, or at least give it a secret key that can’t be guessed.

Posted: Thursday May 23rd, 2013 at 7:11 pm #50493

Please go to the site and go to the footer http://fernleafconsulting.co.uk (see Posted: Friday May 17th, 2013 @ 4:31 am). In there, bottom left, use the login link. /FPWP/wp-admin/ is disabled to avoid hacking.

Thank you for the comment on the hacks file. I left it there as I have reset it a number of times to get back to where I am now but I will remove it in due course. As a matter of interest I added a training video of 45mins yesterday on S3 and it ran first time and streams well, only to level one members.

Posted: Thursday May 23rd, 2013 at 8:59 pm #50506

Got it. I tried the Login link you showed me and after trying the credentials you sent I got the same screen Bruce got earlier:

The error message is blank, but the box is there, so I don’t know what’s wrong but something’s not behaving normally there. Could you review that and get it working so I try again?

Also, please verify that the credentials are correct and resubmit them using the contact form, please. Let me know after sending them. Thanks! s2Member® » Private Contact Form

Posted: Friday May 24th, 2013 at 7:47 pm #50581

Thank you for looking. I am at a loss as to why you cannot login. So I have replaced the password and sent you another login. I hope this works. I can see the failed logins so it maybe I have sent you a miss-typed password or something, I am unsure.

I note that you and Bruce have mentioned the error bar on the login. This is of course an s2member page and the message has been missing since I installed s2member and this login appeared. I have simply replaced the logo banner. I have never investigated why the error message is blank, because I have had other things to do, but I am sure it is not an indication of our download problem. Everything else on s2member is working fine (including logins) as far as I am aware and as I originally said to Bruce this may well be me starring at the obvious and unable to see it.

I look forward to hearing from you.

Posted: Friday May 31st, 2013 at 6:34 pm #51079

This thread was started Posted: Thursday May 2nd, 2013 @ 6:27 pm. Could I please have a reply and the support you promised.

Posted: Friday May 31st, 2013 at 11:58 pm #51108

I’m sorry, I had not seen your previous reply and it ended being pushed down by other posts.

Got the updated credentials and this time I was able to login to the admin area.

I tried the PDF file you had mentioned before but it seems to have been removed now. Found your Video Test page, but the test.mp4 file you used there doesn’t exist either.

Could you tell me the name of a few of the files in your S3 bucket to test the playback with JW Player and the download? Filenames are case-sensitive, so please copy/paste them exactly as they are named.

You can also show me a screenshot of the files in the bucket you integrated s2Member with.

By the way, I re-read your first post and noticed this question that I missed the first time: “How do I set some to 0 and some to 1.” You mean some files only downloadable by Level 1 users? See: [hilite path]Dashboard -› s2Member® -› API / Scripting -› Custom Capability and Member Level Files[/hilite]

If you want Level 1 users not being able to download Level 0 files, you’ll need to customize the roles. See: Knowledge Base » Levels without incremental access

Viewing 25 replies - 1 through 25 (of 47 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.