We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16610
    • 634 Posts
    The question is: What is the easiest way to protect extranet files while using MODx?

    For now I have used: FileDownload + FileDownloadPlugin + modified FileUpload combo. This is an ok solution but little clumsy because users can add and delete files only from frontend.

    Other solution I have used when there is only few extranet users is .htaccess based file directory protection which is enough in most cases.

    But is there any other solution for protecting files? Is there for example a way to combine .htaccess based directory protection straight to MODx user management?
      Mikko Lammi, Owner at Maagit
      • 7231
      • 4,205 Posts
      What if you were to keep the files below the web level on the sever and use code to retrieve them (maybe fileupload plug-in can do this) to retrieve them. This way they would be unavailable for browsers but could be reached by code, I think this is a safe way to store files since not only the user does not see the path but the path is unreachable anyway. However this adds a problem for managing the files. If the editor user is only going to access these files and no others then you could simply set the resource path for this user to the hidden folder. Otherwise you could build a module that uploads file to the hidden folder like the File Manager.

      Disclaimer: This is pure theory, I have never tried this so is not proven to work. grin
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 16610
        • 634 Posts
        Thank you very much for your suggestions.

        @dew_cv: Your suggestion is actually very close with FileDownload + FileDownloadPlugin + modified FileUpload combo. I have modified FileUpload to use folders below the web level. Works fine, but files are managed only through frontend.

        @ganeshXL: I like this module idea. I thought also that it would be very hard to link TinyMCE with protected folders but a module would solve this. Own folder for every user would also be great. Will try to implement this one. Thanks!
          Mikko Lammi, Owner at Maagit
          • 7231
          • 4,205 Posts
          File Manager module can be set to reach bellow the web level by changing the path. I think that every user can have custom File Manager paths. Maybe that could be a starting point.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 16610
            • 634 Posts
            Quote from: dev_cw at Apr 03, 2008, 12:27 PM

            File Manager module can be set to reach bellow the web level by changing the path. I think that every user can have custom File Manager paths. Maybe that could be a starting point.

            Yes smiley This is the easiest way to go. Works like a charm and fits my needs anyways. No need to write a new module.

            So, the original question is solved and the easiest solution found is: FileDownload + FileDownloadPlugin + FileUpload + File Manager Path -configuration from MODx configuration or from user settings.
              Mikko Lammi, Owner at Maagit