Released 0.5.0.
Before I explain what changed, if you update you have to run the following after having updated the extension through composer:
php flarum migrate
php flarum cache:clear
- re-enable a random (other) extension to flush the language files
- set up the download permission
Not doing so will break your forum, guaranteed.
After several days of relentless coding I present a big update to flagrow/upload
.
Upload now is able to show the downloads, this functionality is extensible. Downloads are now proxied through php (read flarum) allowing you to track downloads (dashboard/stats soon), but also to protect your downloads from being hotlinked outside of your forum. Another security measure is the ability to configure a download permission (next to the upload permission), unlocking a wide range of scenarios I imagine.
Please note the previews are still very much work in progress. For one, it still shows the image url, which negates the concepts of the above protection. I'll patch this up in a coming minor release.
If you encounter any issues, please open an issue on github, much appreciated ?.
Long changelog:
- WasUploaded event is removed. It was a duplicate for WillBeSaved.
- Adds file download templates; a button as default and an image preview. Includes file size.
- Added WillBeDownloaded and WasLoaded events used in the downloading functionality.
- Removed markdown string generation and dependency. Now using raw xsl documents.
- Added ability to inject a custom downloader instance, mutating how downloads are handled.
- Refactored uploading by separating code into repository. Catching errors properly now.
- Download permission added.
- Added a PHP proxy, by which:
- The extension can now track downloads, enabled by default (disable in the admin settings page).
- The extension can prevent hotlinking, enabled by default (disable in the admin settings page).
- Understands where files are located in your forum once downloads are tracked.
- Streams remote files, which automatically upgrades downloads to https in case your forum has SSL.
On behalf of the Flagrowians, happy uploading ? !