我使用Fine Uploader 5.1.3进行S3多部分上传,如果我一次性上传分块文件,则在我的上传存储桶中使用REST头的服务器端签名和(我认为)适当的CORS配置。但是,当我尝试恢复上传时,我收到以下错误(在Firefox中; Chrome的行为有点不同但也不起作用):
阻止跨源请求:同源策略禁止在https://upload-dev.artsquare.com/w%2Fv_vangogh%2FfaCgY2vR1KnYyTgicwZxCt%2FVincent_van_Gogh_-_De_slaapkamer_-_Google_Art_Project.jpg?partNumber=1&uploadId=_9hDMgz3y991sj3aOR_B5mPRRamtnF_KK.moucWnOOYN__N3SI2MBWEafT.EF0TSmfS9HU0xscTeKGUJLnW06lFSZmAITTEgyxug3a3uMBL7nZMdAxf73O1c.BunY0JN读取远程资源。这可以通过将资源移动到同一域或启用CORS来解决。
我以为我已经设置了所有必要的CORS配置,但我在这个桶上改为全开放策略:
Active (Managed by Xcode)
我仍然遇到这个问题。在收到错误消息之前,我没有在网络监视器中看到任何预检。我注意到Fine Uploader在该预检之前没有提出任何签名请求;这可能是一个错误,并且Fine Uploader应该在这里签署一个签名请求吗?还有其他调试建议吗?
更新
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
<ExposeHeader>ETag</ExposeHeader>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<ExposeHeader>ETag</ExposeHeader>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
我无法复制所有的网络流量,但是一切都完全正常,直到我重新加载,包括中断的PUT:
点击重新加载后,我只看到加载页面的GET流量 - 没有OPTIONS请求触发。然后我在控制台上获得此输出:
Console logs for successfully uploading a chunk:
"[Fine Uploader 5.0.9] Parsing template" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Template parsing complete" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Rendering template in DOM." s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Template rendering complete" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Received 1 files or inputs." s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Attempting to validate image." s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Generating new thumbnail for 0" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Attempting to draw client-side image preview." s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Attempting to determine if Vincent_van_Gogh_-_De_slaapkamer_-_Google_Art_Project.jpg can be rendered in this browser" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] First pass: check type attribute of blob object." s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Second pass: check for magic bytes in file header." s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Sending chunked upload request for item 0: bytes 1-5242880 of 264631945" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Submitting S3 signature request for 0" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Sending POST request for 0" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] 'Vincent_van_Gogh_-_De_slaapkamer_-_Google_Art_Project.jpg' is able to be rendered in this browser" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Submitting S3 initiate multipart upload request for 0" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Sending POST request for 0" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Moving forward with EXIF header parsing for 'Vincent_van_Gogh_-_De_slaapkamer_-_Google_Art_Project.jpg'" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] EXIF Byte order is little endian" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Found 14 APP1 directory entries" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Successfully parsed some EXIF tags" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Initiate multipart upload request successful for 0. Upload ID is P_r2TsqKpH1vZOYWa.w2hiGYrrdK8goX1KVWFz6DD29lLEcVpMmEeXQpoQj2XUzWN_ko4vw3_6Nicqosv6TLZgD1bzsIB5cnk5xMkBz_4fqziJn3gVmZLb4WKv9tEJx7" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Submitting S3 signature request for 0.0" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Sending POST request for 0.0" s3.jquery.fineuploader.min.js:16:1895
Image corrupt or truncated: blob:http://localhost:8080/e3b89765-7509-437d-baba-365046dfcfd0 e3b89765-7509-437d-baba-365046dfcfd0
NS_ERROR_NOT_AVAILABLE: s3.jquery.fineuploader.min.js:20:0
no element found w%2Fv_vangogh%2FfaCgY2vR1KnYyTgicwZxCt%2FVincent_van_Gogh_-_De_slaapkamer_-_Google_Art_Project.jpg:1:1
"[Fine Uploader 5.0.9] Received response status 200 with body: " s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Chunked upload request succeeded for 0, chunk 0" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Chunk 0 for file 0 uploaded successfully." s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Sending chunked upload request for item 0: bytes 5242881-10485760 of 264631945" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Submitting S3 signature request for 0.1" s3.jquery.fineuploader.min.js:16:1895
"[Fine Uploader 5.0.9] Sending POST request for 0.1"