2015-12-02 71 views
0

工作我使用下面策略格式和創建與政策基礎64和簽名SHA基地64應用程序/ JSON格式,但得到精細上傳請求不從VB6

"Error attempting to parse signature response: SyntaxError: Unexpected token s"

您能否提供我在哪裏錯了:

strToPolicy = "{ 
    ""expiration"": ""2015-01-01T12:00:00.000Z"", 
    ""conditions"": [ 
     {""bucket"": manishtests3.s3-website-ap-southeast-1.amazonaws.com }, 
     {""acl"": ""public-read"" }, 
     {""key"": my access key id}, 
     {""x-amz-meta-qqfilename"": Search.png}, 
    ] 
}" 

回答

0

你的政策似乎僅僅是畸形的JSON ...注意到以下格式:

{ 
    "conditions": [ 
     { 
      "bucket": "manishtests3.s3-website-ap-southeast-1.amazonaws.com" 
     }, 
     { 
      "acl": "public-read" 
     }, 
     { 
      "key": "my access key id" 
     }, 
     { 
      "x-amz-meta-qqfilename": "Search.png" 
     } 
    ], 
    "expiration": "2015-01-01T12:00:00.000Z" 
} 

欲瞭解更多信息,還有一個具體的example of Amazon S3 Policy Format在利用Fine Uploader和Amazon S3方面。

+0

之後,我得到這個迴應:XMLHttpRequest無法加載https://mytestupload.s3.amazonaws.com/。預檢反應無效(重定向) –

+0

之後,我收到了以下回復:XMLHttpRequest無法加載https://manishtests3.s3.amazonaws.com/。預檢反應無效(重定向)。我只是改變端點,因爲它說404錯誤,所以我將它改爲manishtests3.s3.amazonaws.com。現在說上面的話。 –

+0

這看起來是對一個跨源請求的錯誤響應。你確定你已經正確設置了[CORS配置](http://blog.fineuploader.com/2013/08/16/fine-uploader-s3-upload-directly-to-amazon-s3-from-your-瀏覽器/#basic-cors-config)在您的S3存儲桶中? –