public function PrivateS3fsStream::getExternalUrl in S3 File System 4.0.x
Same name and namespace in other branches
- 8.3 src/StreamWrapper/PrivateS3fsStream.php \Drupal\s3fs\StreamWrapper\PrivateS3fsStream::getExternalUrl()
Returns a web accessible URL for the resource.
The format of the returned URL will be different depending on how the S3 integration has been configured on the S3 File System admin page.
Return value
string A web accessible URL for the resource.
Overrides S3fsStream::getExternalUrl
File
- src/
StreamWrapper/ PrivateS3fsStream.php, line 32
Class
- PrivateS3fsStream
- Defines a Drupal s3fs stream wrapper class for use with private scheme.
Namespace
Drupal\s3fs\StreamWrapperCode
public function getExternalUrl() {
$s3_key = str_replace('\\', '/', $this->streamWrapperManager::getTarget($this->uri));
return Url::fromRoute('system.private_file_download', [
'filepath' => $s3_key,
], [
'absolute' => TRUE,
'path_processing' => FALSE,
])
->toString();
}