- Issue created by @saidatom
- Merge request !8Handle External URL Schemes Like ftp:// in File URL Fields Without Errors. β (Open) created by saidatom
When attempting to use an external URL (e.g., ftp://example.com/file.txt) as the value for a file_url field, the following error is triggered:
Drupal\Core\File\Exception\InvalidStreamWrapperException in Drupal\Core\File\FileUrlGenerator->doGenerateString() (line 105 of core/lib/Drupal/Core/File/FileUrlGenerator.php).
This occurs because the FileUrlGenerator expects a supported stream wrapper (public://, private://, etc.) but does not recognize or handle external URL schemes like ftp://.
Update the RemoteFile
class to handle external URL schemes by implementing a createFileUrl()
method. This method will return the fileβs URI directly using getFileUri()
, bypassing the unsupported stream wrapper logic.
Active
2.0
Code