Aikeedo has two filesystem services. Use the CDN for anything a user will see, and the local filesystem for private working files. Both are Flysystem instances, so the usual write(), read(), delete() and listContents() methods are available.
Store a user-visible file
src/Services/AttachmentStore.php
Don’t build URLs yourself. When signed URLs are enabled, getUrl() returns a time-limited URL, and a hardcoded path won’t work.
File entities
File\Domain\Entities\FileEntity and its image subclass record where a file lives so other code can resolve it later. Images take dimensions and a blurhash placeholder:
Private working files
Paths are relative to the installation root. Keep scratch files under var/, which isn’t web-accessible, and clean them up when you’re done.
Validate uploads
Never trust the client. At minimum, cap the size and sniff the real MIME type:
Decide the extension from the sniffed MIME type, not from the client’s filename, and never write a file whose key comes from user input. generatePath() avoids both problems.
Base64 payloads in a JSON body work the same way once decoded: check the decoded length before you write anything.
Adding a storage backend
Everything above uses whichever adapter the administrator selected. To add a new backend, such as another S3-compatible provider, implement the CDN adapter interface and register it. See Storage adapters.