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.

Download links

Home Forums Community Forum Download links

This topic contains 29 replies, has 5 voices. Last updated by  Jason (Lead Developer) 4 years, 2 months ago.

Topic Author Topic
Posted: Sunday Sep 30th, 2012 at 12:35 am #26998

We are selling access to posts with videos streaming video via Amazon S3/Cloudfront. We are using the PHP code provided under the JW Player® ( RTMP streaming MP4, via s2Member’s Amazon® S3/CloudFront integration ) example. The video streams fine, but we want to have a downloadable link as well to that video so they can download it to their computer. I was adding a simple anchor tag with with download link at the very bottom of the PHP, like:

<a href="Christie_vs_Josie_members_area_content.pds.mp4">Click Here To Download This Video To Your Computer</a>

or

<a href="http://cherrybombwrestling.com/?s2member_file_download=Christie_vs_Josie_members_area_content.pds.mp4">Click Here To Download This Video To Your Computer</a>

Every once in a while one of these will work, but most of the time it does not. How should we provide a download link to the videos?

Thanks

List Of Topic Replies

Viewing 25 replies - 1 through 25 (of 29 total)
Author Replies
Author Replies
Posted: Monday Oct 1st, 2012 at 5:29 am #27041
Raam Dev
Username: Raam
Staff Member

Hi Jeremy,

That second link should work. When you say “most of the time it does not” work, what exactly does that look like? What happens? Do you get an error?

Posted: Monday Oct 1st, 2012 at 9:24 am #27071

I get the pop up box that says “–Confirm File Download– you have downloaded x out of unlimited..”, so at this point you think it’s going to work, but instead you are redirected to a server not found page. The URL it is trying to go to is something like

http://d21c73yl3bucq3.cloudfront.net/Tracy_vs._Taeler_Download5.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2QyMWM3M3lsM2J1Y3EzLmNsb3VkZnJvbnQubmV0L1RyYWN5X3ZzLl9UYWVsZXJfRG93bmxvYWQ1Lm1wNCIsIkNvbmRpdGlvbiI6eyJJcEFkZHJlc3MiOnsiQVdTOlNvdXJjZUlwIjoiMTY2LjE0Ny4xMjAuMTU2LzMyIn0sIkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxMzQ5MTg0MDk0fX19XX0_&Signature=Otfu6ed4rurwq2Id2kKe8ROK1-itBKSK2MMzWIocQd-y08TVEws1nF0-UuFvzxOBk8HtZddPwTwYSBNJx1y4eRvVgFO06TKkG18QxEImUpqX315b8GNha7yHjGEiBMR3ROr3QvqYaDG~MG3-qr1a4fG5BY98m791rhJESXxAhtY_&Key-Pair-Id=APKAIR7XZJCDEEHIK6UQ

We are getting some pretty hostile customers so I appreciate any help.

Posted: Monday Oct 1st, 2012 at 11:34 am #27086

Hello Jeremy,

Can you please go into your amazon console and check that the download distribution still exists it sounds like it may have been deleted?

Also on a side note I noticed that you’re allowing the option to take card details on your site but don’t appear to have an SSL certificate installed, so in that case its payment will not work and your want to look into that.

Let us know about the distribution.

Thanks

Posted: Monday Oct 1st, 2012 at 1:12 pm #27092

You were right, the cloudfront was disabled for some unknown reason, I enabled it and waited about 30 minutes, but now when I click on the download link it gives me an access denied xml page:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied

Access Denied
D792462E5E4F969D

IzSYST0OTiM6xaERRzjrbDipUoWCkGYrtRbaM7gRgCjvWhURbRdtz+4D7bhGp9Vy

Any idea on why it would be doing this? Also she does have SSL on the site, but probably not enabled on those posts, I can go back and enable that.

Thanks for your help.

Posted: Monday Oct 1st, 2012 at 1:15 pm #27094

Sorry on that last post, I just realized that the xml had “code” tags in it. It should’ve looked like:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<\Code\>AccessDenied<\/Code\>
<Message>Access Denied</Message>
<RequestId>D792462E5E4F969D</RequestId>
<HostId>
IzSYST0OTiM6xaERRzjrbDipUoWCkGYrtRbaM7gRgCjvWhURbRdtz+4D7bhGp9Vy
</HostId>
</Error>
Posted: Monday Oct 1st, 2012 at 1:22 pm #27097

Can you check the contents of the crossdomain.xml file located in the top level of the s3 bucket your using, see if its corrupted

Posted: Monday Oct 1st, 2012 at 3:12 pm #27118

OK the crossdomain.xml file says it has errors in it when I open it. Another strange thing is there seems to be something writing files to the bucket, they look like 2012-10-01-19-03-44-5592hgsbe… which i am assuming every time a video is accessed it is creating one of these files since they look like date and times. Could the error in the xml file be causing this? If I simply delete the crossdomain.xml will a new one be created error free? I am new to this service, but looks great when it works.

Posted: Monday Oct 1st, 2012 at 5:44 pm #27133

What goes in the xml file? I found this in another post, would this apply to any crossdomain.xml file?

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>
Posted: Monday Oct 1st, 2012 at 5:51 pm #27134

Yes put that in the xml file and make sure the file is ‘public’.

As for the ‘2012-10-01-19-03-44-5592hgsbe’ that sounds like your have logging enabled on the bucket, so amazon is writing log files every time someone tries to access files. You can turn that off by going to your bucket properties.

Let us know how you get on after fixing your crossdomain file.

Posted: Monday Oct 1st, 2012 at 6:01 pm #27135

Ok I deleted it, and added the one I posted above, made it public, but when I try to download from a download link I get

This XML file does not appear to have any style information associated with it. The document tree is shown below.

AccessDenied
Access Denied
97707C4D5981E331
<host id>
QuWagjR+XyesqMKkUBICBd2uV2SOt7qVCGeP1kE+3Ws6PSJu8bAOU07xSMxOKI/c
</host id>
 

The streaming works fine, as it always has, it’s just the download links.

And you were right, logging was turned on, I disabled that.

  • This reply was modified 4 years, 3 months ago by  Jeremy Pigg.
  • This reply was modified 4 years, 3 months ago by  Jeremy Pigg.
  • This reply was modified 4 years, 3 months ago by  Jeremy Pigg.
Posted: Monday Oct 1st, 2012 at 6:11 pm #27139

Can you try this please:

<a href="[s2File download="yourvideo.mp4" /]">download</a>

Also are the files in the top level of your bucket or a sub-folder?

Posted: Monday Oct 1st, 2012 at 6:18 pm #27140

Getting the same thing, it really looks like a permission issue:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
Code AccessDenied Code
<Message>Access Denied</Message>
<RequestId>B808FEE35817CF97</RequestId>
<HostId>
lvhr6BaSAm/Djdg/4MBpp0Rrp8LeBzDL0anC73W5ewatvzHMX+jGK8B2c/OPVBQF
</HostId>
</Error>

I read somewhere that the crossdomain.xml file needs some type of restrictions, have you ever heard of this?

Posted: Monday Oct 1st, 2012 at 6:30 pm #27144

Not necessarily as amazon gives the same message if you’re trying to access something that doesn’t exist at that location.

Can you double check your using the correct file name and correct path.

remember that you cannot download from the cloudfront url that was setup for the streaming.

<a href="[s2File download="file-relative-to-your-amazon-bucket.mp4" /]">download</a>
  • This reply was modified 4 years, 3 months ago by  Philly.
Posted: Monday Oct 1st, 2012 at 6:36 pm #27147

I even tried a different post that time, my exact string I put in was:

<a href="[s2File download="Leilani_Kai_vs_Taeler_Hendrix.mp4" /]">download</a>

Where Leilani_Kai_vs_Taeler_Hendrix.mp4 is the name of the file in the S3 bucket. Got the same error.

Posted: Tuesday Oct 2nd, 2012 at 3:39 pm #27245

Anything?

Posted: Tuesday Oct 2nd, 2012 at 4:19 pm #27256

Its strange that the streaming is working but not the download.

Can you post the code your using to make this file stream without problem

‘Leilani_Kai_vs_Taeler_Hendrix.mp4 ‘

can you also locate that file in your bucket, click on it, view properties and copy and paste the link here that amazon provides.

Thanks

Posted: Tuesday Oct 2nd, 2012 at 5:07 pm #27264

We probably have 10 different videos just like this that is streaming fine, but the download links do not work

<?php
// Configuration.
$s2_jw_config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
$s2_jw_config["mp4_video_file_name"] = "Leilani_Kai_vs_Taeler_Hendrix.mp4"; // Name of your MP4 test file.
// Don't edit anything else below unless you know what you're doing.
?>

<div id="jw-container">JW Player® appears here.</div>
<script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>

<?php /* A direct URL to the RTMP source; counting the file against the current User in real-time. */
$cfg = array ("file_download" => $s2_jw_config["mp4_video_file_name"], "url_to_storage_source" => true, "count_against_user" => true); ?>

<?php /* API Function `s2member_file_download_url()` returns false if access is denied to the current User. */
if (($mp4 = s2member_file_download_url ($cfg, "get-streamer-array"))) { ?>

    <script type="text/javascript">
        jwplayer("jw-container").setup({modes: /* JW Player®. */
        [
            /* First try real-time streaming with Flash® player. */
            {type: "flash", provider: "rtmp", src: "<?php echo $s2_jw_config["jwplayer"]; ?>player.swf",
                config: {streamer: "<?php echo $mp4["streamer"]; ?>", file: "<?php echo $mp4["file"]; ?>"}},
        
            /* Else, try an HTML5 video tag. */
            {type: "html5", provider: "video",
                config: {file: "<?php echo $mp4["url"]; ?>"}},
        
            /* Else, this is a safe fallback. */
            {type: "download", /* Download the file. */
                config: {file: "<?php echo $mp4["url"]; ?>"}}
        ],
        /* Set video dimensions. */ width: 480, height: 270
        });
    </script>

<?php } else /* Access is denied to the current User. */ { ?>
    Sorry, you must become a VIP member to view this video. 
<?php } ?>
<a href="[s2File download="Leilani_Kai_vs_Taeler_Hendrix.mp4" /]">download</a>
Posted: Tuesday Oct 2nd, 2012 at 5:28 pm #27267

Sorry Jeremy but I’m not sure what it could be.

Lets see what Cristián or Raam thinks?

While your waiting can you check that the url your being directed to when you get the access denied message matches the url given for your ‘download’ distribution that s2member created in cloudfront. Can’t see why it wouldn’t but you never know.

Posted: Tuesday Oct 2nd, 2012 at 6:13 pm #27274

If I right click, save as, the file it tries to save is Leilani_Kai_vs_Taeler_Hendrix.xml. If I right click and copy link address I get http://cherrybombwrestling.com/?s2member_file_download=/Leilani_Kai_vs_Taeler_Hendrix.mp4 copied to my clipboard. I’m don’t even see how that is possible.

Posted: Tuesday Oct 2nd, 2012 at 6:15 pm #27275

If I right click and open in a new tab, which of course would be the same as just clicking on it, the browser tries to load http://cherrybombwrestling.com/?s2member_file_download=/Leilani_Kai_vs_Taeler_Hendrix.mp4, but is redirected to

http://d21c73yl3bucq3.cloudfront.net/Leilani_Kai_vs_Taeler_Hendrix.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2QyMWM3M3lsM2J1Y3EzLmNsb3VkZnJvbnQubmV0L0xlaWxhbmlfS2FpX3ZzX1RhZWxlcl9IZW5kcml4Lm1wNCIsIkNvbmRpdGlvbiI6eyJJcEFkZHJlc3MiOnsiQVdTOlNvdXJjZUlwIjoiMTA4LjcwLjEyMi4yMDkvMzIifSwiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjEzNDkzMDI0MjB9fX1dfQ__&Signature=DKR0F0kWuLPSffEymTktu04XguUKY60i-4d0ldnMs7qugVYkEqBs3RcWbLDGVo7w6Hx2qqY8KwK0NVPGxRLFcAptqpXDTwUQO0gg6Fmm4UqC3fo8FnVVcx1baulhvktq5K9mpKuAMsxi~z-4cuv-Ms~YQiZhuh8TJ4xGx6RJEmc_&Key-Pair-Id=APKAIR7XZJCDEEHIK6UQ&#8221;

And then I get the

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
Code AccessDenied Code
<Message>Access Denied</Message>
<RequestId>8DF3B5C61BC35D18</RequestId>
<HostId>
WAk3yibE6wLo3AvIvWJ+ZTVrBxV52VpkycSxpN3ilRQBYguQtnxwF7nS0eIpO2mY
</HostId>
</Error>
Posted: Tuesday Oct 2nd, 2012 at 8:05 pm #27280

I’ve got another off topic question, the site owner is wanting to do away with credit card transactions and just use paypal because we can’t get her SSL to work on the posts selling the videos. She has an SSL cert installed, and we installed the WordPress HTTPS plugin, but when we check “secure post” it doesn’t secure it, therefore none of the credit card transactions are working properly like you mentioned above.
Is there a way to turn off credit cards and keep the code we have already generated for the previous posts, or do you know the secret to make SSL work on wordpress?

Posted: Wednesday Oct 3rd, 2012 at 4:45 am #27306

I don’t think the certificate is installed correctly, as navigating to https:// manually redirects to http://

Posted: Wednesday Oct 3rd, 2012 at 8:49 am #27332

I know right, I called Godaddy about it and they said I needed to do redirects, he didn’t understand the redirects were going to redirect if I did, I just don’t have much more time to spend on this project. Please let me know if you find out something about the download links.
Thanks

Posted: Thursday Oct 4th, 2012 at 2:32 am #27393

I’m not a PHP pro by all means, is there a simple way to force a download w/a PHP string? Maybe that will help

Posted: Thursday Oct 4th, 2012 at 7:21 am #27415

If I right click and open in a new tab, which of course would be the same as just clicking on it, the browser tries to load http://cherrybombwrestling.com/?s2member_file_download=/Leilani_Kai_vs_Taeler_Hendrix.mp4, but is redirected to

I don’t know why that is. I just emailed Jason asking him what the reason could be.

I’m not a PHP pro by all means, is there a simple way to force a download w/a PHP string? Maybe that will help

Well, you can try using a download key in the URL, but I don’t know if that’d make a difference, since the problem seems to be with the CloudFront service. [hilite path]Dashboard -› s2Member® -› Download Options -› Advanced Download Restrictions[/hilite]

Viewing 25 replies - 1 through 25 (of 29 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.