We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38181 ☆ A M B ☆
    • 26 Posts
    Hi,

    I am wanting to have a media source which is just giving access to /assets/images in Revolution 2.2.

    I created a media source by duplicating the filesystem media source, renamed it and changed just the basePath and baseURL to be /assets/images. (Note I have not touched allowFileTypes - it is still blank.

    The new media source appears correctly in my file tree and it shows the list of subdirectories that sits under my assets/images directory. But (even when logged in as admin) no files are shown in any of the directories - it is a directory listing only?

    Any ideas?

    Thanks as always
    Tim [ed. note: [email protected] last edited this post 14 years, 2 months ago.]
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      If I'm not incorrect, the only media source available right now is the main filesystem. I'm not aware that what you're trying to do will work the way you're attempting (even if it makes sense). Rather, you'll want to create a usergroup and roles for media source users, and restrict access to just that folder. But use the default media source "filesystem".

      I suggest taking a long undisturbed walk through http://rtfm.modx.com/display/revolution20/Security
      And another leisurely stroll at Bob's Guides
      http://bobsguides.com/revolution-permissions.html

      If you click on the menu at Bob's Guides, under MODX Permissions are two sets of tutorial links. Check those out too.

        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 38181 ☆ A M B ☆
        • 26 Posts
        Hmmm ... OK ... but the system offers me the option to 'duplicate' the filesystem media source, so if it not to do what I am attempting, then what purpose does it serve?

        I have worked through the security elements a number of times and in that regard my setup is working in so far as I have set up user profiles that can ONLY see my new media source and cannot see the filesystem media source. But that is a red herring here as even as admin I get no files in my new media source.

        Re: Bobs guides they are terrific - and I have bought the book as well - thanks Bob - but his tutorial relates to tree_root_id which as I read it relates to resources; I want to restrict access to the files in filesystem, not resources and in any case, his note at the top of the page indicates that it is deprecated from 2.2 (which I am using), which I assume to be that it is replaced by media sources.

        Very greteful for the response as always on the forum, but not sure we've got to the bottom of this one yet (at least in my mind). Will carry on trying a few more things ....

        Tim
          • 3749
          • 24,544 Posts
          Media Sources are definitely the way to go.

          It might be a problem with the file permissions or ownership.


          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 38181 ☆ A M B ☆
            • 26 Posts
            Ok ... I can add some more to this.

            If I select my media source (logged in as either admin or other user makes no difference) and I try to upload a file to a directory (right clicking on a directory in my media source tree) and then select to upload a file, it fails with an error in the notes column of the upload panel saying 'the specified directory is not a directory'.

            Any ideas why in a media source it doesn't consider these directories to be directories, where in the filesystem (from which I have simply duplicated) it all works fine?

            Tim
              • 38181 ☆ A M B ☆
              • 26 Posts
              Sorry to add as well even if I create a new directory using my media source tree and then try to upload files it also fails with the same - so it doesn't see directories created from within the tree itself as being directories?
                • 3749
                • 24,544 Posts
                Can you upload files to *any* directory using the Media Source tree?


                ------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using.
                MODX info for everyone: http://bobsguides.com/modx.html
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 3749
                  • 24,544 Posts
                  Have you checked the permissions and ownership on the upload directory?

                  It might help to know if the FileUpload snippet works for you. If not, the problem doesn't have anything to do with Media Sources.


                  ------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using.
                  MODX info for everyone: http://bobsguides.com/modx.html
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 38181 ☆ A M B ☆
                    • 26 Posts
                    RESOLVED:

                    The basepath and baseurl settings must have trailing /

                    (May be a thought to put a check into the code for this at some stage so that it puts it on if the user has forgotten to put it on ....)

                    Hope the post helps any others that may fall into the trap and thanks for your assistance Bob.

                    Tim