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.

Stream Audio but Restrict Audio downloads.

Home Forums Community Forum Stream Audio but Restrict Audio downloads.

This topic contains 10 replies, has 3 voices. Last updated by  Cristián Lávaque 3 years, 8 months ago.

Topic Author Topic
Posted: Tuesday Apr 9th, 2013 at 7:43 pm #46947

I have an app that builds an audio file on the fly, stores it in the s2member-files directory and gives the user option to download (restricted by their userlevel) or stream which I don’t want any restriction on. The download option is working great but the audio will not stream.

I have tried using &s2member_file_inline=yes but it still won’t. If I move the file back to an unprotected directory it steams fine. I think I need to alter .htaccess somehow to say protect downloads but not streams but have no idea how.

Help.
Rob

List Of Topic Replies

Viewing 10 replies - 1 through 10 (of 10 total)
Author Replies
Author Replies
Posted: Wednesday Apr 10th, 2013 at 7:56 am #47064

Hi Rob.

Have you tried the things in this article? Knowledge Base » Resolving Problems with File Downloads

Posted: Wednesday Apr 10th, 2013 at 10:37 am #47089

Thanks. I did go through this article and as I said the download is working great, limiting depending on the user. However when the user tries to play the audio from the same file it gives an error regardless of the audio player I try. It is like the player does not have access to that directory.

Rob

Posted: Wednesday Apr 10th, 2013 at 7:27 pm #47134
Bruce
Username: Bruce
Staff Member

Thanks. I did go through this article and as I said the download is working great, limiting depending on the user. However when the user tries to play the audio from the same file it gives an error regardless of the audio player I try. It is like the player does not have access to that directory.

Can you try adding the variable shown in the Advanced Download Optioins? That will allow anyone to access the file through a particular link for a short amount of time.

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

Posted: Wednesday Apr 10th, 2013 at 8:27 pm #47139

Wow, you guys are amazing. I saw that option but did not understand its purpose. Works great! thanks.

Posted: Wednesday Apr 10th, 2013 at 9:04 pm #47142

Ok I spoke too soon. Still does not work but I want to make sure I have the syntax right. Should this work, where I put the s2 stuff on the end of the player code? I am generating the key earlier, from the same file.

http://localhost/wpfinal/wp-content/themes/u-design/js/niftyplayer.swf?file=http://localhost/wpfinal/wp-content/plugins/s2member-files/521e9fc95b3c3b1772dad957ed129f2b.mp3&as=0&s2member_file_download=521e9fc95b3c3b1772dad957ed129f2b.mp3&s2member_file_download_key=dd821ee40646561aad0c09ea1870638a

Posted: Thursday Apr 11th, 2013 at 9:04 am #47185

Since the file’s address is at the end of the player’s URL, I’d use the mod_rewrite format. [hilite path]Dashboard -› s2Member® -› Download Options -› Advanced Mod-Rewrite Linkage[/hilite]

Posted: Thursday Apr 11th, 2013 at 10:37 am #47197

Thanks Cristian,

I had already tried that but did take a much closer look at it. Here are the two variations I tried, neither worked. If you tell me I have the right syntax then I might go to plan b, copy the file into an unprotected directory for player only.

niftyplayer.swf?file=http://localhost/wpfinal/wp-content/plugins/s2member-files/s2member-file-inline=yes/s2member-file-download-key=33df11dcdbb8b788d42374437931fa92/825ce31dc53c452b50a3c300569f4d6c.mp3

niftyplayer.swf?file=http://localhost/wpfinal/wp-content/plugins/s2member-files/88830fb3d8b841b2ded85274c1dc31d9.mp3&s2member_file_inline=yes&s2member_file_download_key=f8724cfa2bd6b42ea6dcd95fb24de620

Do these look right?
Thanks

Posted: Friday Apr 12th, 2013 at 5:14 am #47279

No, you’re using an equal sign (=) in the mod_rewrite one, but it should be a dash (-). [hilite path]Dashboard -› s2Member® -› Download Options -› Advanced Mod-Rewrite Linkage[/hilite]

Try this:

http://localhost/wpfinal/wp-content/plugins/s2member-files/s2member-file-download-key-33df11dcdbb8b788d42374437931fa92/825ce31dc53c452b50a3c300569f4d6c.mp3

You may need to update the download key, though. Try opening the file like that first, then try it in the player.

Posted: Friday Apr 12th, 2013 at 11:30 am #47313

Hi again.

Whoops, I was using = with the file version. Have now tried this:
http://localhost/wpfinal/wp-content/plugins/s2member-files/s2member-file-download-key-d20acffbf17412f6bacc438f08d39592/a1837da890af72f37605c20117abe5b8.m4a

and still no luck.

After testing the s2Member download keys with a test page that works, I have found a work-around for my problem page assuming it has something to do with that code, and I will revisit late if required. Thanks for all your help.
Rob

Posted: Tuesday Apr 16th, 2013 at 4:02 am #47586

After testing the s2Member download keys with a test page that works, I have found a work-around for my problem

Great! Thanks for the update. :)

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