2014-07-23 3 views
0

PHP에서 S3로 파일을 업로드했습니다.PHP를 통해 S3로 파일 업로드하기

나는 php.ini에서 업로드 파일 크기 제한을 변경했으며 set_timeout을 통해 php 파일을 변경했습니다.

내 문제는

6MB 이내에 파일을 업로드 할 수 있습니다. 하지만 업로드하는 데 4 분이 걸립니다. 하지만 50MB 이상의 파일은 10 분 이상 걸립니다.

어떻게 해결할 수 있습니까? 내 코드를 수정할 수있는 권한이 있어야합니다. 나는 그것을 위해 s3.php 파일을 사용하고있다.

+0

그래서 당신은 지금까지 무엇을했는지? –

답변

0

당신은 파일을 직접 업로드 사용해야

<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> 

도 : http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingHTTPPOST.html

예제 코드 : http://docs.aws.amazon.com/AmazonS3/latest/dev/HTTPPOSTExamples.html

+0

"onchange"이벤트에서 파일 업로드를 사용하고 있습니다. onchange 이벤트에서 ajax로부터 PHP를 호출했습니다 –

+0

서버 대신 "onchange"이벤트에 amazon s3 파일을 보냅니다. –

+0

나는 이렇게 보내고있다. 하지만 업로드하는 데 더 많은 시간이 걸립니다. –

관련 문제