2

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,

  1. I will send a GET request to backend(laravel) for a presigned URL.
  2. 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.

  1. 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 as Key. But for my purpose I cannot send multiple file_names since it doesn't make sense.
  2. 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?

  • you need to generate one URL per file to be uploaded. The AWS SDK does not support multiple file uploads in a single request as far as I know that's just AWS CLI and Console "trickery". – apokryfos Dec 10 '21 at 09:23

0 Answers0