Upload
@adminjs/upload
The upload feature helps organize your files and keep information about them in database.
There is possibility to use different storage for files:
local filesystem
AWS S3
Google Cloud Storage
To install the upload feature run:
The main concept of the upload feature is that it sends uploaded files to an external source. The database keeps the information about path and folder name where the file was stored.
The feature uses following terms
key
is the path of the stored filebucket
is the name of the container
First we have to create in our database table where we store information about our files.
Below is written interface for entity. Feel free to add your own fields to store other data connected with file.
Next, you should decide, where your files will be stored and prepare resource entry for AdminJS
In this example your local server should have established bucket
folder and it should be accessible by web browser (via baseUrl
path)
After that add files resource to AdminJS options config
If you would like to deal with multiple files with single database entry it will be necessary to modify config files
Last updated