Hello, all. I've been looking at this forum and have not found this information. I'm looking for a way that users can upload documents, view them on a list, then download them, as well. I want the user to view and download only documents he or she has uploaded. These functions would be links to pages in the profile page. The user would click on the 'view documents' link to see a list of files they'd uploaded. Each file name in the list would have a link to download that particular file. I have scripts to upload files, create a directory, view the list of documents and download files. I think I would need to create a directory for each user, which would reside in another directory that is protected. How would I go about getting the username, user id or variable, or whatever I need to create the directory with the user's unique identifier as the name of the directory that only he or she can access? Is there a another way to do what I want, that I am missing? Thanks
Thanks for the response. I looked at the page, especially the first example, the test.php. I am still a bit confused. Can you explain it a bit, please? What value is stored in the following: $user = $event->getUser(); // User object Can I retrieve the value from this variable to use in a query? For example, SELECT login from am_user WHERE login = $user, or something like that? I may not be explaining myself very well. I want members to be able to upload documents, but only view the ones they have uploaded. If I create a folder called doc_uploads to store uploaded documents, and then protect it, I assume anyone who is logged in can see ALL of the documents of that folder. My idea is that I can have a script create a folder for each member upon upload, have it name the folder based on their login id or email, or whatever value is in $user, then protect that folder. Any documents uploaded can only be viewed by the person who uploaded it. Sounds really complicated, I know. Thanks, again.
$user = $event->getUser(); This is user object that already have all necessary variables. You can access user login this way: $user->login
For what it's worth, this would be a nice option or add-on for aMember. I could see how it would be useful in my business model for example. I'd love to see a brick on the dashboard that just says MY DOWNLOADS which refers to customer specific files uploaded by the admin on the back end. Almost like the user comments area in the admin area except the files WOULD be visible on the client side. So the administrator would log into the back end admin area, locate a user and click on their username. Then on the member details page (still in the back end), maybe right below the optional comments area, there could be an upload form to attach a file to THAT specific user. Attached files would appear just below that upload form on the back end and on the client side would appear in the MY DOWNLOADS brick. Very cool idea that I think would be useful to a LOT of people, if you think about it - makes sense!
I was able to use the information from the getUser() method and apply it to my upload/download scripts to allow logged-in users view their files. I'm still doing some testing, but it's mostly working the way we need it to. Thanks again.
Hi there Would it be possbile please to share the scripts that you have created as I am trying to achieve the same thing. Cheers, Hugh
If you use wordpress, there is a $20 plugin that will achieve this. It requires a minor tweak to work with amember, but the developer did it for me free of charge after I bought the script. http://www.najeebmedia.com/nmedia-file-uploader-pro/
Just FYI - aMember did implement the feature I described above, it's called Personal Content and works quite well. It doesn't allow users to upload files (at least I don't think) but it does allow admins to upload files to specific customers, where said files are only view able by the user they are assigned to.
I got the perosnal content plugin but there is no documentation for it. Its installed, but nothing comes up in dashboard for it. Please help.
I havent used the personal content plugin on 4.x yet, but on 3.x you would create a master directory with an .htaccess file and any other default content for amember to copy into amember created member folders. the htaccess file content for 3.x: ########### AMEMBER START ##################### AuthType Basic AuthName "Members Only" AuthUserFile /home/yoursite/public_html/amember/data/.htpasswd Require user <!--LOGIN--> ########### AMEMBER FINISH #################### David
No, it works differently in v4. I am sorry for lack of documentation, we will fix it ASAP. In short, once you enable the personal-content plugin, there will be a new field added at bottom of users profile at aMember CP -> Browse Users -> Edit. You may upload files using this new field. Users will see files you uploaded for them in the member area. http://yoursite.com/amember/member