We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30912
    • 463 Posts
    Hello all, its been a while, a lot has changed since i was last here.

    i'm back in the web development fold for the first time in a while and seeing the changes in 2.4 i couldn't resist.

    I need to have a media source outside of the web root as its going to be storing product images which will then be watermarked. However we cannot have the source images accessible by anyone other than the webserver itself for displaying the images. I instantly thought Media sources will do it...however seems i was wrong.

    Ive set up my media source, assigned the permissions to allow the user to access the media source, its visible in the file browser, phpthumb can see the files, a user can select the image, upload, delete etc, however in the TinyMCE editor i get a small image icon, not the image and its not visible on document preview.

    basePath: /home3/myuser/files/
    baseUrl: files/
    Both basePathRelative and baseUrlRelative are set to no

    What am I missing?

    Thanks

    EDIT: Would open_basedir have anything to do with it? [ed. note: Tyreal2012 last edited this post 10 years, 9 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      TinyMCE expects to be able to access images via a URL. If it's outside of the web root, then it cannot be accessed with a URL, it must be explicitly streamed.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 30912
        • 463 Posts
        Shoot....

        That looks like that was it....guess i'll have to find another solution for protecting these images.

        Thanks Susan!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          How about creating the images with the watermarks and storing them in a web-accessible directory upon creation? You probably wouldn't be able to upload images from TinyMCE, but you could access them to insert them into the content.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 30912
            • 463 Posts
            Marketing don't want to maintain two sets of images :/ [ed. note: Tyreal2012 last edited this post 10 years, 9 months ago.]
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              You could automate the entire process from the Media Browser with a plugin to do various things upon the various file handling events. On upload, create the watermarked images and put them in place. On delete remove the watermarked images. Or whatever you wanted to do, just managing the images from the Media Browser. They would only need to maintain the one set of raw images.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 30912
                • 463 Posts
                A good idea, however not all the images will be watermarked, only product. its certainly something to think about!

                Thanks Susan