S3Upload bundle allows you to easily upload files to Amazon S3 by helping you upload files, storing metadata about the files in a separate collection
AppFiles and providing resolvers to download the urls.
We are using Apollo Upload scalar to transfer the files through the GraphQL API.
Or if you have them already in your
.env files, no need to be specified in bundle configuration when adding it to kernel:
Basically you'll have a bunch of entities linked with files through
Nova linking with
AppFilesCollection. For example, an User has an avatar:
In GraphQL typing it will look something like this:
When adding the avatar, after uploading it can look something like this:
If for example you have a "place" where you upload more files. For example, a
Comment can contain many pictures. The solution we recommend is creating a conglomerate called
FileGroup which stores and manages these, and link that fileGroup with the entities you're interested in.
Files get deleted when
appFiles get deleted by
_id. This is done because of security and performance concerns.
This will automatically delete it from the S3 as well. This is handled in
AppFileListener via a
BeforeRemoveEvent for the documents.
You can create your own S3UploadService if you have special handling for things such as image compression or others:
For thumbnails of images we recommend that you store these files separately in their own
AppFile and manage them separately.