-
MODX Staff
- 10,725 Posts
You could write a quick module in the manager to give the manager users access to those files by using a php script to list the files, as well as to grab the content of the files from this location outside the web server paths and deliver it to the browser from the executing module script.
But I really do not think the file manager, at least not in any currently recognizable form, is the proper place for this specialized functionality of pointing at files any place on the file system.
Thanks OpenGeek, I am sure you are right. I am building a specialist system so this is may not be a good idea for all modx users.
I am not knowledgeable enough on these matters to be able to debate the issue, but I still do not see that if the download link was scripted instead of anchor referenced how anything would change other than the added ability of being able to download a file from outside the website root directory. The File Manager currently allows the uploading and deleting functions to work in this way and deleting would pose a greater risk than downloading wouldn’t it?
Anyway, my temporary solution was to make a folder inside the website root directory called uploads and password protected it with an .htaccess file as nightsignals originally suggested. Then inside the "uploads" folder I created another folder called "documents" and made this the root folder for the File Manager. This meant that the "documents" folder was password protected but the .htaccess file was not able to be accidentally deleted because it was one level higher than File Manager root directory.
This still meant that I was unable to download the files from within the File Manager so I just inserted the username:password I used to protect the folder into the anchor reference after the https:// and voilà... it works. Not exactly an elegant solution, but a solution none the less. The one issue is of course is that the username:password shows in the link and is therefore visible to anyone that has access to the File Manager. This is not a concern for my system but it may be for others.
I will revisit this and try to get my original idea working at a later stage when time allows... thanks to all that offered their advice.