通过PHP将文件上传到S3

通过PHP将文件上传到S3,php,amazon-web-services,amazon-s3,Php,Amazon Web Services,Amazon S3,我已经从PHP上传文件到S3 我已经更改了php.ini中的上传文件大小限制,还通过设置超时更改了php文件 我的问题是 我可以上传一个6MB以内的文件。但上传需要4分钟。但超过50MB的文件需要10分钟以上的时间 我怎样才能解决这个问题?有任何可能修改我的代码。我使用的是s3.php文件。您应该使用文件直接上传 <html> <head> ... <meta http-equiv="Content-Type" co

我已经从PHP上传文件到S3

我已经更改了php.ini中的上传文件大小限制,还通过设置超时更改了php文件

我的问题是

我可以上传一个6MB以内的文件。但上传需要4分钟。但超过50MB的文件需要10分钟以上的时间


我怎样才能解决这个问题?有任何可能修改我的代码。我使用的是s3.php文件。

您应该使用文件直接上传

   <html>
      <head>
        ...
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        ...
      </head>
      <body>
      ...
      <form action="http://samar.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
        Key to upload: <input type="input" name="key" value="user/eric/" /><br />
        <input type="hidden" name="acl" value="public-read" />
        <input type="hidden" name="success_action_redirect" value="http://johnsmith.s3.amazonaws.com/successful_upload.html" />
        Content-Type: <input type="input" name="Content-Type" value="image/jpeg" /><br />
        <input type="hidden" name="x-amz-meta-uuid" value="14365123651274" />
        Tags for File: <input type="input" name="x-amz-meta-tag" value="" /><br />
        <input type="hidden" name="AWSAccessKeyId" value="AKIAIOSFODNN7EXAMPLE" />
        <input type="hidden" name="Policy" value="POLICY" />
        <input type="hidden" name="Signature" value="SIGNATURE" />
        File: <input type="file" name="file" /> <br />
        <!-- The elements after this will be ignored -->
        <input type="submit" name="submit" value="Upload to Amazon S3" />
      </form>
      ...
    </html>
图表:


示例代码:

到目前为止您做了什么?我正在使用onchange事件上的文件上载。我在onchange事件上从ajax调用php,在onchange事件上发送文件amazons3,而不是您的服务器。但是上传需要更多的时间。上传需要一些时间,这取决于你的网速。但是这需要5分钟以上的时间,而且ajax显示了警告:显示了进程头