我想上載照片使用fineuploader 3.8.2在索尼Xperia Tipo或HTC Evo 3D與Android 4.0和麪臨一個奇怪的問題。同時,通過攝像頭的作品上傳,通過畫廊上傳不工作,並給我 無效根據政策策略條件未能啓動,以$內容類型「」錯誤
$('#fineuploader-s3').fineUploaderS3({
request: {
endpoint: "http://mybucket.s3.amazonaws.com",
accessKey: "MYACCESSKEY"
},
signature: {
endpoint: "myendpoint",
},
objectProperties: {
acl: 'public-read',
key: =>
uploaded_image_key = qq.getUniqueId()
return "#{uploaded_image_key}.png"
},
iframeSupport: {
localBlankPagePath: "/myiframe.html"
},
text: {
uploadButton: '<div><i class="icon-upload"></i> Upload Image</div>'
},
uploadSuccess:{
endpoint: null
},
template: 'mytemplate',
camera: {
ios: true
},
multiple: false,
retry: {
showButton: true
},
validation: {
allowedExtensions: ["gif", "jpeg", "jpg", "png"],
acceptFiles: "image/gif, image/jpeg, image/png"
},
chunking: {
enabled: true
},
resume: {
enabled: true
}
}).on('complete', (event, id, fileName, responseJSON) =>
if responseJSON.success
$(@el).find('#thumb_pics').append("<img class='thumb' src ='http://s3.amazonaws.com/mybucket/#{uploaded_image_key}.png' title = '#{fileName}' />")
$('#submit_feedpost').prop('disabled', false)
).on('error', (event, id, fileName, errorReason, xhr) =>
$('#submit_feedpost').prop('disabled', false)
alert(errorReason)
)
我的政策是這樣的 -
'{
"expiration": "myexpirationdate",
"conditions":[
{"bucket": "mybucket"},
["starts-with", "$key" , ""],
{"acl": "public-read"},
{"success_action_status": "200"},
["starts-with", "$Content-Type", ""],
["starts-with", "$x-amz-meta-qqfilename", ""]
]
}'
我CORS是這樣的 -
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
你在哪裏看到這個錯誤?裝置? JavaScript控制檯? –
您將需要提供* some *指示錯誤發生的位置,然後*任何*代碼可能與此錯誤的原因相關(例如,客戶端js和控制檯消息,甚至可能是網絡選項卡)。 –
當試圖從圖片庫上傳照片時,在Nexus上出現同樣的錯誤,但直接從相機上傳時它工作正常 – Bikash