I want to specify a different file system remote server path. So that if I upload a file then this should be served from different remote server. I am using Drupal version 8.

  • You have to write php stream wrapper(ie. form scratch or re-use some, and define it for drupal as available scheme).
    – user21641
    Jul 17 '17 at 12:49

You'll need a custom Stream Wrapper, which provides read/write operations to your remote file system (those docs are for Drupal 7, but the concept, if not implementation, is identical).

Fortunately, for Drupal 8 someone's written a stream_wrapper_example module, which contains a lot of boilerplate code for re-use.

There are also a bunch of existing community-supplied stream wrapper modules, a Google search like "drupal stream wrapper modules" will list them all for you. Obviously whether or you can re-use any of those depends on exactly what you mean by "remote", and how you're implementing the connection.

  • This will be great start for a beginner and learn something. Thanks. Jul 17 '17 at 12:58

You can simply use a NFS and configure the file system to this one. No need to develop a streamWrapper with this method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.