내 코드에서 AjaxFileUpload 플러그인을 사용하고 있지만, IE8 및 IE10은 AjaxFileUploadHandler.axd에 POST에 요청 헤더에 쿠키를 전송하지 않습니다. ie8의 맨 아래에있는 "눈"아이콘을보고 AjaxFileUploadHandler.axd가 "blobked"하다는 것을 알기 때문에 쿠키를 보내지 않습니다. 내 web.config 아래에 태그가 있지만 문제는 AjaxFileUpload에 대한 스크립트가 dll에서 가져온 것이므로이 AjaxFileUploadHandler도 여전히 "차단됨"입니다. 나는 프로젝트의 DLL을 생성하는 AjaxControlToolkit에 소스 코드를 다운로드했으며, 이제는 P3P 헤더를 추가하여 어디서나 행복하게 될 수있는 곳을 찾고있다. 툴킷 코드에서 XMLHttpRequest()를 볼 수 있습니다. 즉,이 P3P 헤더를 추가하여 XML을 만족시킬 수 있습니까?XMLHttpRequest에 P3P 응답 헤더를 추가 할 수 있습니까?
편집 : 수정은 =이 "제한"iframe.security을 주석하는 것입니다; 아래 코드를 업데이트했습니다.
<httpProtocol>
<customHeaders>
<add name="P3P" value='CP="Potato"'/>
</customHeaders>
</httpProtocol>
특히이 문제는 툴킷에서 사용하는 iframe과 관련이 있습니다. P3P를 iFrame에 추가하는 방법이 있습니까?
this.createIFrame = function() {
var name = this._iframeName,
iframe = document.createElement("IFRAME");
iframe.width = "0";
iframe.height = "0";
iframe.style.display = "none";
iframe.src = "about:blank";
//iframe.src = "javascript:'<script>window.onload=function(){document.write(\\'<script>document.domain=\\\"" + document.domain + "\\\";<\\\\/script>\\');document.close();};<\/script>'";
iframe.id = name;
iframe.name = name;
//iframe.security = "restricted";
document.body.appendChild(iframe);
iframe.contentWindow.name = name;
$addHandlers(iframe, {
load: Function.createDelegate(this, this.onIFrameLoadedHandler)
});
this._iframe = iframe;
};
this.onIFrameLoadedHandler = function (e) {
/// <summary>
/// Event handler to capture when iframe receive response from server.
/// </summary>
/// <param name="e"></param>
if (!control._currentFileId)
return;
try {
var iframe = this._iframe, doc = null;
// Only test the iframe data, exception should thrown if something went wrong.
if (iframe.contentDocument)
// Firefox, Opera
doc = iframe.contentDocument;
else if (iframe.contentWindow)
// Internet Explorer
doc = iframe.contentWindow.document;
else if (iframe.document)
// Others?
doc = iframe.document;
if (doc == null)
throw "Document not initialized";
// finalizing and upload next file
control.doneAndUploadNextFile(control.getCurrentFileItem());
} catch (e) {
// Cancelation/aborting upload can causing 'Access is denied' or 'Permission denied' on IE 9 bellow,
// let's consider this exception is not trully error exception from server.
if (!control._canceled || !(e.message && (e.message.indexOf("Access is denied") > -1 || e.message.indexOf("Permission denied") > -1))) {
this.raiseUploadError(e);
throw e;
}
}
};