Save and set an external link image programatically I have a field that will accept an image link coming from the external source. But of course, to set that image I have to save it in Drupal first. I'm wondering how do Drupal save the image from an external link. I use the following code.

$imageUri = 'https://api.statvoo.com/favicon/?url=google.com'; // this is a favicon

$file = File::create([
          'uri' =&gt; $imageUri,
          'status' =&gt; 1,
        ]);
$file-&gt;save();

$user_profile-&gt;field_profile_image[] = [
        'target_id' =&gt; $file-&gt;id(),
        'alt' =&gt; 'Alt text',
        'title' =&gt; 'Title',
        'width' =&gt; 200,
        'height' =&gt; 200,
      ];

$user_profile-&gt;save();


I notice that the following values and the external image URL were added in the image field, but the image is not displayed on the page. Thanks in advance!
Well, I think it is supported. I found an exact solution I need to be able to save and set an external image source inside Drupal according to Programmatically update node image field (using URI of the image) and get URL in twig.

I use this method system_retrieve_file.