Home › Forums › Community Forum › Restriction to file downloads by Username
Tagged: access, download, file, limitations, restrictions, username
This topic contains 17 replies, has 3 voices. Last updated by Narek Ambar 3 years ago.
Topic Author | Topic |
---|---|
Posted: Tuesday Dec 10th, 2013 at 2:39 pm #61797 | |
|
|
Hello, I’ve watched the full file download video and have searched the forums and I can’t seem to find the answer to this. I am an audio engineer and I want each of my clients to have access to only their own songs (which I will upload.) When a client makes an account and has their own page, how can they only see THEIR files to download. How can I put some kind of tag or something on the file to make ONLY available to a certain username and automatically have it show up on their page when they log in? Any help would be greatly appreciated. Thanks! |
List Of Topic Replies
Author | Replies |
---|---|
Author | Replies |
Posted: Tuesday Dec 10th, 2013 at 10:08 pm #61806 | |
|
|
My understanding is that this is not a normal function of the downloads option. How are you storing/uploading your files and how are you setting up your download links? Dave |
|
Posted: Wednesday Dec 11th, 2013 at 3:35 pm #61825 | |
|
|
Dave, Thank you very much for your reply. I watched the videos so I do have an understanding of how to set things up, but it only has the levels, which wouldn’t work in my situation. Here is the situation: I am an audio engineer and would like each of my clients to have access to only their files when it’s done being mixed. I want them to be able to download only their songs, once they log in to their account. Here is what I want to do: For example: I create a user called “Dave” with a password I select and give to you as the client. Once you login, I want s2member to understand that “Since Dave logged in, I should only show Dave.mp3 and not Jon.mp3, or Mike.mp3, etc…” How can I make s2member understand which files to show based on Username (or any other tagging/filtering method?) Is there a way I can do all this? Thank you for your time, I do appreciate the help. -Narek |
|
Posted: Wednesday Dec 11th, 2013 at 6:29 pm #61834 | |
|
|
Since you create the accounts manually, maybe you can use ccaps and limit the “Dave” user to any content with “Dave” as ccaps. This content can then be the link to Dave.mp3 Something like this: [s2If current_user_can(access_s2member_ccap_Mike)] Would that work? |
|
Posted: Wednesday Dec 11th, 2013 at 7:51 pm #61837 | |
|
|
The “simplest” way I can think to do this is use the custom capabilities option. S2member doesn’t iterate through a downloads folder. You have to actually create each download link yourself. I would suggest giving each client user a specific custom capability like “dave”, “mike”, etc. Then put all the download links on one page with the CC shortcodes like this:
This way, you only create one download page, placing all the file download links on one page but they are protected by custom capabilities of the user. Does that make sense? Dave |
|
Posted: Wednesday Dec 11th, 2013 at 7:52 pm #61838 | |
|
|
HAHA! I should have refreshed the page… all that work for nothin. lol Dave |
|
Posted: Wednesday Dec 11th, 2013 at 8:05 pm #61842 | |
|
|
Funny how we both added Frank as another name! |
|
Posted: Wednesday Dec 11th, 2013 at 8:09 pm #61843 | |
|
|
ha! didn’t notice that. nice. lol! |
|
Posted: Wednesday Dec 11th, 2013 at 8:10 pm #61844 | |
|
|
Hey Cassel, Thank you for the reply, I created a two accounts just to try this method out. I created “Dave” and “Mike” filling out standard wordpress stuff and ONLY the custom capabilities field in the s2member section. For Dave I put “dave” and “mike” for Mike. I made 2 folders inside the “s2member-files” called “access-s2member-ccap-dave” and “access-s2member-ccap-mike” I uploaded each persons files (for mike I uploaded 2 files and for dave I uploaded 1 file) I copied the code that you mentioned and it worked when I logged in with each member. (It displayed the text for each member accordingly.) I changed the text to a link… …and its not loading when I press play. What kind of link can I put for it to not be a player and just a download link. I tried creating a regular “a href=” link with the above link inside it saying “Song Name Download Click Here” for example and when I log in, there is no text. It’s completely blank. Also, in my admin account on the “My Account” page (the only page that belongs to each particular member) do I have to put everyones accounts’ IF statements and files? Does [s2If current_user_can(access_s2member_ccap_mike)] So on and so forth? |
|
Posted: Wednesday Dec 11th, 2013 at 8:21 pm #61846 | |
|
|
Lol I should have refreshed the page, okay okay, let me try David’s method. The frank thing was pretty funny though. Please disregard my last message. I will get back very shortly. Again I really appreciate the help fellas! |
|
Posted: Wednesday Dec 11th, 2013 at 8:27 pm #61848 | |
|
|
Ya I just tried David’s method, and double checked to make sure it’s all correct and matching, but when I log in with a user to download their song, it doesn’t show anything. All white, just blank… I’m confused. Everything makes sense, but I can’t see anything at all. I even logged in with my admin account and the white space is bigger. So there’s something there, but it doesn’t show. I tried using the Chrome Inspect tool to change the color via CSS but no luck. you can highlight the lines as if something is there, but nothing is there.
|
|
Posted: Wednesday Dec 11th, 2013 at 8:28 pm #61849 | |
|
|
NOTE: if you are trying to play the file right there instead of downloading it, you might have to add inline=”yes” to get it to work like this:
I don’t use downloads much so I’m not 100% sure how this works. lol :) Dave |
|
Posted: Wednesday Dec 11th, 2013 at 8:30 pm #61850 | |
|
|
What does your code look like? |
|
Posted: Wednesday Dec 11th, 2013 at 8:50 pm #61855 | |
|
|
I don’t necessarily need it to play right there, just a download link saying “song name download” is fine. Here’s my whole “My Account” page copy pasted.
|
|
Posted: Wednesday Dec 11th, 2013 at 8:56 pm #61856 | |
|
|
What is the direct url to those files? Where do you have them stored? |
|
Posted: Wednesday Dec 11th, 2013 at 9:36 pm #61860 | |
|
|
For example one of them in Mike’s folder is at http://mydomainname.com/wp-content/plugins/s2member-files/access-s2member-ccap-mike/Do_The_Math.mp3 and I upload these files via FileZilla and I made the directories by copy pasting the exact names from the s2member account settings pages/guides. So I don’t understand why it’s all blank and nothing shows. In fact, when I put http://mydomainname.com/wp-content/plugins/s2member-files/access-s2member-ccap-mike/Do_The_Math.mp3 in the URL field of chrome, and I’m logged in, it automatically starts downloading the file…
|
|
Posted: Wednesday Dec 11th, 2013 at 11:12 pm #61864 | |
|
|
Try including the sub directory like this:
Dave
|
|
Posted: Thursday Dec 12th, 2013 at 12:37 am #61868 | |
|
|
I just tried that and it shows the whole entire link So I tried to hit “Link” and put the whole shortcode in the place of the URL and leave the text empty so it creates a standard “a” tag. Wrote “download here” between the “” of the a tag and BOOM! Got myself a download link! Thanks a million! I started expanding and logging in to each persons account and everything’s working great. I tried the inline thing and it didn’t play. That’s not a big issue at all. The main thing I’m a little confused about is why it doesn’t download or play on my iPhone… Btw, how can I hide a Nav Bar page once someone’s logged in (for example the Log In page) or even the opposite. How can I only have a Nav Bar page show when someone (anyone) is logged in (for example the account settings page)? |
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.