Dave Reid created an issue. See original summary.

deviantintegral’s picture

Title: Create an file field widget for adding remote file URLs » Create a file field widget for adding remote file URLs
deviantintegral’s picture

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.

stevector’s picture

Is 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.

Dave Reid’s picture

@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.

stevector’s picture

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.

stevector’s picture

Are you at liberty to share the code from that internal project?

Jaypan’s picture

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:

$uri = '';
$file = File::Create(['uri' => $uri]);
$node->field_file->setValue(['target_id' => $file->id()]);
legolasbo’s picture

Status: Active » Fixed

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.