mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fix support for getting URLs to uploaded files
This commit is contained in:
parent
b58af6a313
commit
4fc736790a
@ -50,10 +50,18 @@ trait UploadableWidget
|
||||
|
||||
/**
|
||||
* Returns the URL to the uploaded file
|
||||
*
|
||||
* @TODO: Replace cms.storage system with real disks
|
||||
*/
|
||||
public function uploadableGetUploadUrl(string $diskPath): string
|
||||
{
|
||||
return MediaLibrary::url($diskPath);
|
||||
// Get the media folder
|
||||
$storageFolder = MediaLibrary::instance()->getMediaPath('');
|
||||
|
||||
// Remove the media folder from the provided disk path since it already has it
|
||||
$url = MediaLibrary::url(Str::after($diskPath, $storageFolder));
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user