【发布时间】:2014-10-21 01:43:25
【问题描述】:
现在我在 javascript 中有这段代码。
var file_object = $('#PHOTO').get(0).files[0];
the_form = new FormData();
the_form.append("AWSAccessKeyId", "TESTING");
the_form.append("acl", "authenticated-read");
the_form.append("policy", policy);
the_form.append("signature", signature);
the_form.append("Content-Type", "image/jpeg");
the_form.append("key", "test.jpg");
the_form.append("file", file_object);
$.ajax({
url: "http://S3BUCKET.s3.amazonaws.com",
type: "POST",
data: the_form,
processData: false,
contentType: false
})
除了 IE6、7、8、9 之外,它在 Chrome、Firefox 中运行良好。
原因是直到IE10才支持文件对象!
https://developer.mozilla.org/en-US/docs/Web/API/File
IE10之前的浏览器有没有变通的解决方案?
PS:代码示例会很好!
【问题讨论】:
标签: file upload amazon-s3 internet-explorer-9 internet-explorer-10