-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a standard place to store uploaded and other volatile files #869
Comments
Of course, storing files in |
I've started a new sprinkle called uf-files. I've put a breif plan in the wiki about how I intend to structure it. |
I've been thinking about this recently. I think build in support for file storage should probably be minimalistic and flexible. I think in some case, it make sense for many sprinkle to put stuff in a shared directory. In other situation might be critical one sprinkle file's can't be overwritten by another one and so on. And renaming files with DB support like @archey347 propose might also be suitable for specific function, but overkill for others (in my project, I want to retain the same file name in the filesystem so I can easily download them via sftp). The best approach for a Core UF functionality might be to provides simple ways to manage files across a centralized location (
As for the |
I've stared implementing centralized storage in UF in the Instead of using a per sprinkle or shared storage, UserFrosting will bundle by default a shared "disk", located in Other benefit is Laravel documentation will be directly applied to UF. One downside is maintaining this integration, but so far it's not that much of a problem. Only thing requires for it to work is to map out the config file correctly. I'll add next the necessary controller methods to access (and probably upload) files to this default storage space. Might as well include #620 in the mix ;) |
The filesystem service has been added to |
UserFrosting requires a file storage service to handle saving user uploaded files (like avatars), or other type of volatile files to the Filesystem and across sprinkles. This of course should be built on top of Laravel Filesystem component. The file storage should also support third party provider if one wants to store file in a AWS instance or Dropbox account for example, but the base structure of the "storage unit" still need to be decided.
The first question is where to store user uploaded files ? We need to
gitignore
this location, but provides an easy way for dev to backup this data. Do we create a centralized location (expublic/storage
orapp/storage
) or should each sprinkle has it's ownstorage/
dir?Second question is how do we structure the file inside that location. Do we require one dir per sprinkle?
I think if we wants sprinkles to interact with other sprinkle files and make it easy to backup, they should be store in a centralized place and optionally be sorted by sprinkles. For example:
Sorting by sprinkle avoid one sprinkle overwriting vital file from another one. Making it optional means two or more sprinkles can interact with the same file. For example, if one handle uploading and one handle dynamic creation, the sprinkle that handle displaying the file don't need to know which sprinkle store the file first place.
I also think such a feature should be in a new sprinkle included in the base install.
This needs to be fixed/decided/implemented before #620 can be implemented.
The text was updated successfully, but these errors were encountered: