drbuowqe02101 2018-04-29 11:01
浏览 223

将多个文件上载到Amazon S3

I need help on how to upload multiple files on Amazon S3. So basically I have three input fields for files upload, two inputs will take 10-20 pictures and last input is only one for one image and upload them to Amazon S3 when a form is submitted.

The form that I'm using for uploading images:

enter image description here

I have a bucket and everything, what I need is some kind of solution to upload multiple images to Amazon S3.

I'm using PHP as my backend and for now, images are stored on hosting when a form is submitted. But I will have more then 150gb of images uploaded every month and I need S3 for hosting those images.

When I connect the form with Amazon S3 and try to upload more than one image, I get this message "POST requires exactly one file upload per request.".

  • 写回答

2条回答 默认 最新

  • douzhigan1687 2018-04-29 16:25
    关注

    S3 is highly scalable and distributed storage.

    If you have those images locally in your machine you can simply use

    aws s3 sync local_folder s3://bucket_name/

    https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

    cli takes cares of syncing the data.

    You can also configure how much parallelism you want on the cli with the configuration settings.

    https://docs.aws.amazon.com/cli/latest/topic/s3-config.html

    You can also do this programmatically if that is going to be a continuous data movement.

    EDIT1:

    Only one file can be uploaded from the UI at one time.

    You can sequence them via javascript and upload one at a time.

    If you want to take it to the backend you can do so,

    https://w3lessons.info/2013/09/06/jquery-multiple-file-upload-to-amazon-s3-using-php/

    Hope it helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号