How to Use Remote Stream Wrapper with Core Media module
The Remote Stream Wrapper module "provides the ability to use external files with file fields without saving the files to your local files directory. Also provides a 'Remote URL' browser plugin for Media."
To begin setting up your site with the ability to use and display remote/external images, download and install the Remote Stream Wrapper module and the Remote Stream Wrapper Widget module. If you are using Drupal 8 core Media module, an image bundle is already setup and ready to use. We will use this bundle as the Field with source information. If a image bundle is not already setup, it can be created at the time the remote/external image bundle is created.
-
Install Remote Stream Wrapper and Remote Stream Wrapper Widget modules
For example, if using composer
composer require drupal/remote_stream_wrapper:^1.3
composer require drupal/remote_stream_wrapper_widget:^1.2-
Create and configure a new media type (structure/media/add)
-
Name: Remote Image (or whatever your choice)
-
Description: Remotely hosted image using Remote Stream Wrapper
-
Media Source: Image
-
-
-
After clicking save, configure the newly created remote image bundle
-
- Add an image field to the newly created remote image bundle (admin/structure/media/manage/remote_image/fields/add-field)
- Configure the image field to use the remote stream wrapper widget (admin/structure/media/manage/remote_image/form-display)
You should now be able to add remote/external images to your Drupal 8 media library. To test go to media/add/[YOUR REMOTE IMAGE BUNDLE], i.e. media/add/remote_image and, give your image a name and enter the URL to a remote image then, save. The remote image should now appear in your media library (admin/content/media).
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion



