我最近购买了适用于S3的FineUploader,但我无法接受来自signature.endpoint的政策和签名。返回的json包含策略和签名数据,但它嵌入了所有包含的“d”属性(MS的“保护我”免受交叉脚本攻击的方式)。我正试图推出直接的浏览器上传,我读了包含python,java和php样本的博客条目,但我将在DotNetNuke中主持这个。我相信我的代码很好,问题是客户端回调因为d而无法读取json。无论我如何尝试返回html(字符串,对象,序列化对象),它总是包含“d”,如下所示:
{ “的 d ”: “{\” 政策\ “:\” 的policyData \ “\ ”签名\“:\ ”SIGNATUREDATA \“}”}
有没有人成功将json从.NET服务器端方法返回到Fine Uploader回调?
<div id="fineuploader-s3"></div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="/scripts/custom.fineuploader-4.0.3.js"></script>
<script>
$(document).ready(function () {
$('#fineuploader-s3').fineUploaderS3({
request: {
endpoint: "bucketname.s3.amazonaws.com",
accessKey: "MYACCESSKEY"
},
template: "simple-previews-template",
signature: {
endpoint: "/aws.asmx/sig"
},
uploadSuccess: {
endpoint: "somefile.html"
},
iframeSupport: {
localBlankPagePath: "success.html"
}
})
// Enable the "view" link in the UI that allows the file to be downloaded/viewed
.on('complete', function (event, id, name, response) {
var $fileEl = $(this).fineUploaderS3("getItemByFileId", id),
$viewBtn = $fileEl.find(".view-btn");
if (response.success) {
$viewBtn.show();
$viewBtn.attr("href", response.tempLink);
}
});
});
</script>