Open saleksin opened 6 years ago
Why don't you just put this files in some directory that is not avaliable from outside,
Flarum beta 7 has two directories available to store files, assets
and storage
. Assets is meant to store permanent files for public use. Storage is meant to be private but stores temporary files. Flarum itself is in itself installed inside a public directory, so without extensive installation instructions it's not possible to store files outside of the public directory. With beta 8 this will change, as it adopts a public
directory now.
and just take them without this additional downloading?
I wanted to make a fast prototype of the upload extension that could potentially use any adapter. Providing the full URL would be required to support this multitude of adapters. But I've always intended to move towards a better way of loading files.
Thanks for your suggestions, when beta 8 comes out every Flagrow extension will be revisited and improved.
flagrow/upload extension version: <0.6.0>
flarum version: 0.1.0-beta.7
upload adapter causing issues: local
mimetype configurations: all
This issue is related to my previous one: #151 First, I have suggestion to rethink the way files are downloaded by local adapter. Currently, on download attempt, Flarum first downloads requested file from itself, and then gives file to user. Second thing is that URL used for this download is stored in database. There are a few potential issues:
If server does not have access to it's URL, then it will not work. It is not so uncommon, especially in development environment, but not only there.
If one wants to change forum's URL, for example for testing in development environments, or just when he want's to change domain name, then all this URLs stops working.
If someone finds this URLs in any way, then all files can be downloaded without login.
Why don't you just put this files in some directory that is not avaliable from outside, and just take them without this additional downloading? Also this way you could avoid storing full URL.