I want to upload multiple files from browser with axios
into s3 bucket. I am using aws-sdk-php
library in laravel
. My intention is when I want to upload one or multiple files,
- I will send a
GET
request to backend(laravel) for a presigned URL. - After receiving the URL I will make a
PUT/POST
request to that URL with all the files.
I have read the aws-sdk-php
docs and found some problems with my intention.
- I have seen that I need to give a
Object Key
when I want to generate a presigned URL. In the docs and other articles they are using file_name asKey
. But for my purpose I cannot send multiple file_names since it doesn't make sense. - Then I thought of generating a UUID and use it as Key. But then how would I access my files individually later? I didn't get any reference to that part.
Can anyone help me with these problem?