0
現在我在javascript中有這段代碼。在IE8中可以從瀏覽器上傳文件到S3嗎?
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
})
它可以在Chrome,Firefox,IE6,7,8,9以外使用。
原因是直到IE10才支持文件對象!
https://developer.mozilla.org/en-US/docs/Web/API/File
是否有IE10瀏覽器之前,任何變通的解決方案?
PS:代碼示例會很好!