We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34027
    • 30 Posts
    michael.graham Reply #1, 12 years ago

    I can't seem to get files to display via a media source. I get a 404 page instead.

    I've created a folder in my webroot called
    board_files_storage/

    I created a media source with the following settings:


    • basePath: board_files_storage
    • basePathRelative: No
    • baseURL: board_files
    • basePathRelative: No

    I placed an image in "board_files_storage" called "smash.jpg"

    When I point my browser to "http://www.example.com/board_files/smash.jpg", I get a 404 error.

    I thought it might be an .htaccess issue. I believe that mod_rewrite is converting the above URL to "http://www.example.com/index.php?q=board_files/smash.jpg". When I enter that URL manually, I also get a 404 error.

    My understanding is that MODx should be serving the media source file, right?

    But when I launch the debugger and trace it through modRequest, it doesn't appear to be running any checks to see if the URL points to a media source.


      • 31946
      • 116 Posts
      I placed an image in "board_files_storage" called "smash.jpg"
      http://www.example.com/board_files/smash.jpg

      I guess that should be "http://www.example.com/board_files_storage/smash.jpg

      Works? smiley
        • 36926
        • 701 Posts
        When i've set one up i have both basePath and baseURL the same, also you may need a trailing slash:

        board_files_storage/
        also prob worth trying
        /board_files_storage/

          • 34027
          • 30 Posts
          michael.graham Reply #4, 12 years ago
          I think I may be misunderstanding how Media Sources work. I thought that MODx serves file-based media sources itself?

          But I'm thinking now that it simply passes through URLs and lets Apache serve the files?

          If that's the case, then how can you use permissions to "lock down" media sources if they're simply visible via apache?