-
-
Notifications
You must be signed in to change notification settings - Fork 92
Description
When we set a remote storage option, and then upload an image, we go to the shared page and a button shows up to download the image. Conversely, if we upload locally, the image displays on the shared page.
I would like to keep the behavior for displaying images, videos, etc on the shared page directly, while hosting remotely.
There are a number of ways this could be done:
a) The script could call the ftp storage and cache it temporarily (but would be slow on large videos);
b) The script could embed the public url, when available, from the cdn or storage service, provided it supports CORS.
c) The script could redirect to the public storage url or public cdn url, or better, it could directly generate those storage urls in the response when we upload things via ShareX.
The later would be the best option, but for that we would need a base_url param in the storage, which would then replace the logic across the script.
For example:
'storage' => array (
'driver' => 'ftp',
'host' => 'storage.bunnycdn.com',
'port' => 21,
'username' => 'myuse',
'password' => 'mypass',
'path' => '/my-storage-name',
'passive' => true,
'ssl' => false,
'base_url' => 'https://mysubdomain.b-cdn.com/somefolder/another',
),
So instead of:
https://myurl.tld/username/someimage.jpg
The script would generate and point to
https://mysubdomain.b-cdn.com/somefolder/another/username/someimage.jpg
This could used for c) or b) (with a setting, so we could have the choice to use it as direct link or preserve the same behavior as the local upload)
Thanks