What's new
Copy file URL to clipboard
New Copy URL action that copies a file's public URL to the clipboard. It's available in the grid card "⋯" menu, in the list view row actions and in the preview sidebar.
- The URL is copied directly in the browser, so it works in Safari too.
- A notification confirms the copy, or reports an error if the browser refuses it.
- The action only appears for files with a public URL, and only in a secure context (HTTPS or
localhost), as required by the Clipboard API.
It's enabled by default and can be restricted like the other actions:
FileManagerPlugin::make()
->canCopyUrl(fn (string $disk, string $path): bool => auth()->user()->isAdmin())Notes
- The copied URL comes from the disk's
urlconfig. For thepublicdisk it's based onAPP_URL, so make sure it uses the right scheme (e.g.https://). - Pro users with the Spatie Permission adapter: create the
file-manager.copyUrlpermission for the action to appear. - New translation keys:
actions.copy_url,messages.url_copied,messages.url_copy_failed(en, it, ar).
Thanks to @umefarooq for the initial implementation (#39)!
Full Changelog: v1.6.3...v1.6.4