This is a migrated thread and some comments may be shown as answers.

Associate uploaded files with a user

1 Answer 29 Views
Editor
This is a migrated thread and some comments may be shown as answers.
SUNIL
Top achievements
Rank 2
SUNIL asked on 26 Aug 2012, 09:57 PM
Suppose, I want to associate each uploaded file with the user who has uploaded it, then how would I do this in RadEditor? I only have a single path for upload, view and delete of uploaded files for all RadEditor managers. This path is '~/RadEditor/UploadedFiles'. There could be 100 or 500 or 1,000 or 10,000 users on my website.
This would mean that when a user opens an image manager or document manager or flash manager or media manager from RadEditor, then he/she would only see files uploaded by him/her.

Thanks
Sunil

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Aug 2012, 01:00 PM
Hello,

It is standard practice to have your users' IDs stored in a database of your CMS, and create a specific folder for each user when a user account is created. Then, when a user is logged and wishes to use the editor, setting the user's folder for this particular logged user is a matter of a single line of code, such as

RadEditor1.ImageManager.ViewPaths = New String() {"~/RadEditor/UploadedFiles/" + LOGGEDUSERID}

Thus each user will have access only to his/her folder and be able to do whatever you let them do, without interfering with other users (and yes, if you have 100 users you will need to create 100 folders).

Another approach is to create a custom content provider that will filters the uploaded files according to the logged user. You can use as a base the provider available in the following live demo: Filter files and download.


Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
SUNIL
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or