【问题标题】:How to upload multi files to amazon S3 directly with the form data?如何使用表单数据直接将多个文件上传到亚马逊 S3?
【发布时间】:2015-10-27 15:58:44
【问题描述】:

前端有一个这样的表单,允许用户插入视频列表记录。

<form action ="" method="post" enctype="multipart">
<input type="file" name="files[]">upload1
<input type="file" name="files[]">upload2
<input type="file" name="files[]">upload3
<input type="file" name="files[]">upload4
<input name="list_name" />
</form>

每条记录至少有 2 个视频文件,最多 4 个文件。

问题是, 来自官方教程,

https://github.com/aws/aws-sdk-php

该文件在上传到 s3 之前临时存储在我的服务器上,我想知道如何在 PHP(或 code-igniter )中直接上传到 s3 ?在开始上传到 s3 之前,还要将“list_name”发布到我的服务器吗?

非常感谢您的帮助。

【问题讨论】:

    标签: php codeigniter amazon-web-services file-upload amazon-s3


    【解决方案1】:

    唯一的办法就是使用多格式

    <form action ="" method="post" enctype="multipart">
    <input type="file" name="files[]">upload1
    </form>
    
    <form action ="" method="post" enctype="multipart">
    <input type="file" name="files[]">upload2
    </form>
    
    <form action ="" method="post" enctype="multipart">
    <input type="file" name="files[]">upload3
    </form>
    

    并使用jquery上传插件上传

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-01
      • 2017-12-15
      • 1970-01-01
      • 2019-02-02
      • 2013-06-09
      • 1970-01-01
      • 2013-10-10
      • 2015-10-14
      相关资源
      最近更新 更多