2011-04-19 2 views

답변

0

당신은 내용 - 처리 헤더를 사용하여 대화 상자 다른 이름으로 저장을 사용자에게 메시지를 표시 할 attachment 속성을 지정할 수 있습니다 :

public ActionResult Download() 
{ 
    var cd = new ContentDisposition 
    { 
     FileName = "foo.xml", 
     Inline = false 
    }; 
    Response.AppendHeader("Content-Disposition", cd.ToString()); 
    var xml = Encoding.Default.GetBytes("<root>some content</root>"); 
    return File(xml, "text/xml"); 
} 
관련 문제