❤️ Support Masonite so we can continue to build new packages!
pip install masonite-filemanager
A simple yet powerful file management solution for your masonite application.
pip install masonite-filemanager
Add FileManagerProvider to your project in config/providers.py
:
# config/providers.py
# ...
from filemanager.providers import FileManagerProvider
# ...
PROVIDERS = [
# ...
# Third Party Providers
FileManagerProvider,
# ...
]
Then you can publish the package resources (if needed) by doing:
python craft package:publish filemanager
Finally add following to STATICFILES
section in config/filesystem.py
:
# config/filesystem.py
STATICFILES = {
# ...
# FileManager resources
'resources/vendor/filemanager': 'filemanager-assets/',
"storage/framework/filesystem/filemanager": "filemanager-uploads/",
}
Once finishing configurations, you can access the file manager by using the following route:
http://localhost:8000/filemanager
If you want to use file picker then all you have to do is include then follow the following guidelines:
Add style in the header of your base template:
Add script before the </body>
tag of your base template:
Finally, in your form you can use selector in your form in the following way:
or, if you want file-preview:
The design of the file-picker is very basic so you might want to customize with your own design by modifying the stylesheet which resides in storage/vendor/filemanager
directory.
masonite-filemanager is open-sourced software licensed under the MIT license.
Last update: