파일을 업로드하고 파일의 속성 (이름, 크기 등)에 관한 json 응답을 보내려고합니다. IE를 제외한 모든 브라우저에서 정상적으로 작동합니다.IE에서 Json 응답 다운로드
IE는 JSON을 파일로 다운로드하려고 시도합니다!
나는 IE10을 가지고 있으며 디버거에서 브라우저 모드와 문서 모드를 변경하여 IE7에서 10까지 테스트합니다.
asp.net mvc4를 사용하고 있습니다. 파일 업로드 작업에 HttpPost 속성이 있으며 json 응답을 반환합니다. return Json (myObject);
그리고 여기 내 HTTP 헤더
요청
Key Value
Request POST /File/UploadFile/ HTTP/1.1
Accept text/html, application/xhtml+xml, */*
Referer http://localhost:63903/
Accept-Language en-NZ
User-Agent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Content-Type multipart/form-data; boundary=---------------------------7dc1e71330526
Accept-Encoding gzip, deflate
Host localhost:63903
Content-Length 1377002
DNT 1
Connection Keep-Alive
Cache-Control no-cache
응답
Key Value
Response HTTP/1.1 200 OK
Server ASP.NET Development Server/11.0.0.0
Date Tue, 18 Dec 2012 23:44:19 GMT
X-AspNet-Version 4.0.30319
X-AspNetMvc-Version 4.0
Cache-Control private
Content-Type application/json; charset=utf-8
Content-Length 154
Connection Close
나는 몇 가지 제안을 시도했지만 있습니다 지금까지 다시 원점으로!
그래서 ... 무엇이 문제입니까? –
내 나쁜 ... IE는 파일로 json을 다운로드하려고 시도합니다. – smehnawal
[IE에서 서버의 json 결과를 열거 나 저장하라는 메시지가 표시 될 수 있습니다] (http://stackoverflow.com/questions/6114360/ie-prompts-to-open) - 또는 - save-json-result-from-server) –