File management
Intro
Files uploaded in the creator module are managed through the FileUploadController.php controller via two uploaders
- FileUploader.php
- ImageUploader.php
File uploader
The file uploader handles all files which are not of image types. They are uploaded to the relevant S3 bucket set in the filesystems.php file.
Image uploader
The image uploader handles all file uplaods of type: - .jpg - .jpeg - .gif - .png
These files are first compressed by the Kraken service before they are uploaded to S3 bucket. To enable this the following attributes need to be added to the .env file:
KRAKEN_KEY=
KRAKEN_SECRET=
Handle duplicate file names
In order to avoid overwriting files with duplicate names, both uploaders have a handleDuplicateFileNames() method. This checks the relevant storage for an existing file of same name and adds _{i} to the end of the file name before storing.