2013-02-18 2 views
0

브라우저에서 파일을 업로드하려고하는데 완전히 작동하지 않습니다.S3 통과 후 CORS 업로드가 중단됩니다.

<?xml version="1.0" encoding="UTF-8"?> 
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> 
    <CORSRule> 
     <AllowedOrigin>*</AllowedOrigin> 
     <AllowedMethod>PUT</AllowedMethod> 
     <AllowedMethod>POST</AllowedMethod> 
     <AllowedMethod>GET</AllowedMethod> 
     <MaxAgeSeconds>3000</MaxAgeSeconds> 
     <AllowedHeader>*</AllowedHeader> 
    </CORSRule> 
</CORSConfiguration> 

그리고 내 코드에서 나는이를 보내고있다 :

나의 버킷 CORS 구성은

xhr.open('PUT', "http://upload.test.s3.amazonaws.com/" + uploadFile.get("dest") +'?' + "partNumber=" + (part + 1) + "&" + "uploadId=" + uploadFile.get("uploadId"), true); 
xhr.setRequestHeader("Authorization", uploadFile.get("authorization")); 
xhr.setRequestHeader("x-amz-date", uploadFile.get("date")); 
xhr.setRequestHeader("Content-Type", uploadFile.get("rawFile").type); 
xhr.setRequestHeader("x-amz-acl", "public-read"); 
xhr.send(chunk); 

추신 : UploadFile로는에서 제공되는 인증 키와 uploadId 같은 몇 가지 특성을 가지고 서버.

업로드가 시작되면 OPTIONS 요청을 통과하지만 Put 요청은 몇 초 후에 중단됩니다 (보통 콘텐츠 비율을 보낸 후 4-5 초 후). 불행히도 아무런 피드백없이 중단됩니다. 아무도 무슨 일이 일어날 수 알고 있습니까 ??

감사합니다.

편집 : 기본적으로 나는 멀티 파트 업로드에서 UploadId (나는 전체 업로드 작업을 위해 서버를 사용하는 경우 작동) 얻을 https://github.com/LearnBoost/knox을 사용하고

그것은 와일드 카드를 사용할 수있는 서버처럼 보이는

답변

0

(즉, "*") CORS 인증을 사용하는 경우 this을 확인하십시오.

양동이의 AllowedOrigin 헤더에서 요청 도메인을 지정해 보았습니까?

관련 문제