We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37743
    • 49 Posts
    As an experiment, I set up a custom Media Source using an ftp url on a different server. The aim is to provide a (read-only) central library of chunks etc in one location that can be accessed by multiple sites.

    The file browser now lists the contents of the remote directory, but when viewing the file (test.txt) it has no contents.

    I realise this probably isn't how the Filesystem MediaSourceType was meant to be used, but I was wondering if anybody had any suggestions on how this could be set up? Would it require a custom Type?
    • I believe that it would require a custom type. It may depend on the local server's configuration, whether or not it's allowed to get tile contents from a remote server.
        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
      • You can test with a simple script that uses
        file_get_contents($ftpStreamUrlHere);
        but I'm not sure if a stream URL for FTP will work like this; untested...
          • 37743
          • 49 Posts
          it works to a point... if i set up the source using a full ftp url ( e.g. ftp://username:password@myserverIP/public_html/lib/ ) then modx can list the files on the server and pull in static chunks from there... just can't write back to it again... but this is all i need.

          Would be handy to have ability to ftp-write though, would mean a (private) central library could be maintained accross multiple projects and cut down on the cut-and-paste of regularly used chunks & snippets.

          The next bit is to figure out how to staticify migx TVs to save having to set them up every time...

          • I know this is an old thread but I would love an external filesystem FTP media source. Also, I'd love to see a package category called media sources so we can see all the sources out there. The only external ones I know about are Swift and Dropbox.
              • 44195
              • 293 Posts
              +1 for an FTP media source!
                I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
                Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com