We are trying to create a page where members can upload files and later on see a list of them. Few specifics:
Members will be allowed to upload and see all kind of files
The uploaded files will be inserted in different Folders based on the Member`s group
Each member will be part of a Member group indicating the customer he
is representing.
Each member should be able to see only the files which were uploaded by members of his/her Member Group
So far we have created partial views via which we are uploading files into Media Library, but we are struggling with creation of logic for showing a list of those files. Can someone help me with this.
I would possibly create a RelationType (in the Developer section of Umbraco)
between the Media Folder (Media) and the Member Group (Member Group). You would then related each Member Group to their appropriate Member folder.
This would enable you in a partial view to get details of the current logged in Member, see which Member Groups they are in, then query the Relations API to determine what the ids of the related Media folders are, then use Umbraco.TypedMedia to get a reference to the Media folders, and then use .Children to loop through the Media items and display links to the items the user is able to see.
One thing to consider is that if a url of a media item from one group is sent to another person who is not in that group, there is nothing to stop that other person from viewing the media item on that Url. There is not out of the box a method in Umbraco for protecting Media by Membership.
There is however a paid for package called Media Protect, that enables you todo that:
Create and show list of Media items
Hi,
We are trying to create a page where members can upload files and later on see a list of them. Few specifics:
So far we have created partial views via which we are uploading files into Media Library, but we are struggling with creation of logic for showing a list of those files. Can someone help me with this.
Thank you in advance :)
Hi MG
Hmmm
I would possibly create a RelationType (in the Developer section of Umbraco) between the Media Folder (Media) and the Member Group (Member Group). You would then related each Member Group to their appropriate Member folder.
Info on relations: https://umbraco.com/follow-us/blog-archive/2012/12/7/getting-to-know-umbraco-relations/ https://our.umbraco.org/documentation/reference/management/services/relationservice
This would enable you in a partial view to get details of the current logged in Member, see which Member Groups they are in, then query the Relations API to determine what the ids of the related Media folders are, then use Umbraco.TypedMedia to get a reference to the Media folders, and then use .Children to loop through the Media items and display links to the items the user is able to see.
One thing to consider is that if a url of a media item from one group is sent to another person who is not in that group, there is nothing to stop that other person from viewing the media item on that Url. There is not out of the box a method in Umbraco for protecting Media by Membership.
There is however a paid for package called Media Protect, that enables you todo that:
https://our.umbraco.org/projects/website-utilities/media-protect/
Hi Marc,
I will give it a try and see how it will turn out. Thank you for the help.
is working on a reply...