I would like to allow users to manage their own files on my web application using a file manager. The specific file manager does not matter, but what I need to know is how to give each user access to their own file directory within my server storage directory (and only allow reading and writing within that folder).
In the backend, each user already has that folder set up as I was allowing them to upload single images before, but everything was handled on the back end, and now I don't understand how to give the user the ability to actually access that directory properly in such a way that the file manager can view and edit the directory contents.
Once again, the file structure already exists and the server side code performs actions within those directories, but now the question is how to expose those directories freely to the user after doing a check that it is their folder and they have the permissions to view / modify. Much appreciated.
FOR EXAMPLE:
ELFinder requires the following parameters:
function elFinderBrowser (field_name, url, type, win) {
tinymce.activeEditor.windowManager.open({
file: 'path/to/file', // use an absolute path!
title: 'elFinder 2.0',
width: 900,
height: 450,
resizable: 'yes'
}, {
setUrl: function (url) {
win.document.getElementById(field_name).value = url;
}
});
return false;
}
I can't just simply pass in to the file attribute storage/subdir/images
because that's not publicly accessible. Also, if I pass in the url to the public directory, the file manager only seems to be able to view the directory web pages. It can't make changes (probably because the public folder is read only).