Open k0rn4l opened 2 years ago
You can write your own disk that extends the original disk.
For example: https://github.com/codeperate/foal-s3-disk-v3/blob/main/src/s3-disk.service.ts
This is my own implementation that change the s3 disk service to use aws-sdk v3.
Hi @k0rn4l 👋
Thank you for your suggestion.
I'm not very familiar with presigned upload/download URLs. Would you have some examples in mind that would show how it works in practice?
Hi @LoicPoullain !
So the idea here is to skip the processing of the uploaded file for the backend, and instead upload it directly to a storage bucket from the frontend ( or other service ). This can be done securely by getting a signed upload url via the AWS SDK from your backend, and send that URL to the frontend. The admin can then use that URL to upload files to the pre selected bucket/folder. The URL expires in the set amount of time.
Same for the download URL. A temporary download link is created, and you can download the contents from there until it expires.
We don't always want to server to handle file uploads, and it's easy enough to use the AWS SDK, but the Disk util is just too convenient. Would it be possible to add this feature to it?
Something like:
Thought this does present a problem, to how to handle local file upload/downloads in this case, I don't have good idea for that one.