Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We should see if we can borrow the code we have for this from our internal project. The original idea behind that was that all of the upload widgets would also full @FieldWidget plugins, which would play nicely here.
CreditAttribution: Dave Reid as a volunteer and at Lullabot commented
@stevector: Right now there's just the stream wrapper support from an API level. I'll post the progress I have for adding a form element for a remote managed file, which then can implemented as a field widget.
CreditAttribution: stevector as a volunteer commented
Cool, thanks Dave Reid! I'm using this module in a Drupal 7 to 8 migration and I was able to get it working to the point that the remote file records are migrated in to Drupal 8 and processed by this module correctly. I can help on the field widget if that is not started/done.
I should write a blog post on how I got the migration working with a custom destination plugin. I also did my first overriding of a service to avoid doing HTTP HEAD requests for remote file size when the file size info is also in the migration source D7 database.
JaypanCreditAttribution: Jaypan at Jaypan commented
Right now there's just the stream wrapper support from an API level.
Is there any documentation on this? I'm comfortable working at a code level, but I don't know what it is I'm supposed to work with.
What I'm trying to do is use a remote file for file, so that I can use the audiofield module as the formatter.
Edit: I figured out what to do. For anyone else interested, you can programmatically create a File entity with the URI set to one of the stream wrappers provided by this module, then set that file entity as the target on your node or whatever entity you are working with:
The Remote stream wrapper widget module provides a widget for both file and image fields. It currently only supports entering the URL, but will in time gain feature parity with core's upload widgets.
Please give it a go and let me know if you've got any issues with it.
Comments
Comment #2
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedComment #3
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedWe should see if we can borrow the code we have for this from our internal project. The original idea behind that was that all of the upload widgets would also full @FieldWidget plugins, which would play nicely here.
Comment #4
stevectorIs there a publicly available widget that can be used with this module? I've enabled the module but I'm not sure what widget to use with it.
Comment #5
Dave Reid@stevector: Right now there's just the stream wrapper support from an API level. I'll post the progress I have for adding a form element for a remote managed file, which then can implemented as a field widget.
Comment #6
stevectorCool, thanks Dave Reid! I'm using this module in a Drupal 7 to 8 migration and I was able to get it working to the point that the remote file records are migrated in to Drupal 8 and processed by this module correctly. I can help on the field widget if that is not started/done.
I should write a blog post on how I got the migration working with a custom destination plugin. I also did my first overriding of a service to avoid doing HTTP HEAD requests for remote file size when the file size info is also in the migration source D7 database.
Comment #7
stevectorAre you at liberty to share the code from that internal project?
Comment #8
Jaypan CreditAttribution: Jaypan at Jaypan commentedIs there any documentation on this? I'm comfortable working at a code level, but I don't know what it is I'm supposed to work with.
What I'm trying to do is use a remote file for file, so that I can use the audiofield module as the formatter.
Edit: I figured out what to do. For anyone else interested, you can programmatically create a File entity with the URI set to one of the stream wrappers provided by this module, then set that file entity as the target on your node or whatever entity you are working with:
Comment #9
legolasboThe Remote stream wrapper widget module provides a widget for both file and image fields. It currently only supports entering the URL, but will in time gain feature parity with core's upload widgets.
Please give it a go and let me know if you've got any issues with it.