joebd's picture

I have an old D7 module that uses remote stream wrappers to add files on Amazon s3 to a filesystem in Drupal.  There is no Remote Stream Wrapper module in Backdrop.

How do I accomplish this in Backdrop?  The old call was

$file=remote_stream_wrapper_file_create_by_uri( $url );

What's the new call?

Any guidance appreciated.

Comments

Yes, that contrib module (Remote Stream Wrapper) has not been ported to Backdrop yet.

  • You may want to request a port in the Backdrop Ops issue queue
  • You can try porting it yourself
  • You can try finding an alternative like S3FS - but I don't know if that will work in your use case...

Good luck!

 

 

I don't think there's a need for a port.  This functionality seems to have come into Backdrop core or is being provided by Filefield_sources.  I could try s3fs, but I think the lightest weight and simplest solution is to use the remote file system capabilities already there.

 

See https://docs.backdropcms.org/api/backdrop/core%21modules%21file%21file.e... and the File::$uri item which notes "The URI to access the file (either local or remote)."

This implies that the capability to handle remote urls as files is already there in Backdrop core.