0
我試圖從我的Silverlight應用程序在新窗口中打開下載的文件。我們有一個遺留應用程序編寫的html/js,適用於任何文件類型。但是,在我的SL應用程序中,對於任何文件類型而不是.txt或.html,窗口會短暫彈出並關閉。我沿着小提琴手前進,兩個應用程序的請求都是相同的。爲了進一步解釋我在做什麼,我使用System.Windows.Browser.HtmlPage.Window.Invoke來調用一個調用window.open的js函數。有沒有人有一個想法可能會發生在這裏?從silverlight應用程序下載文件
這裏的頭......
請求:
GET https://foofoo.com/portal/fileDownload?SupportingUploadedFileId=8147&IdeaId=110391 HTTP/1.1
Accept: */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Host: foofoo.com
Connection: Keep-Alive
Cookie: __utma=42251826.1339254382.1292255942.1292255942.1292255942.1; __utmz=42251826.1292255942.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=95617934.1162172004.1292440807.1292618204.1292859812.4; __utmz=95617934.1292440807.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); hubspotdt=2010-12-20%2010%3A43%3A36; hubspotutk=027b6ef3c2cb40a7a727706cbd686cd0; hubspotvd=027b6ef3c2cb40a7a727706cbd686cd0; hubspotvw=027b6ef3c2cb40a7a727706cbd686cd0; hubspotvm=027b6ef3c2cb40a7a727706cbd686cd0; JSESSIONID=UXFMkU3DZrCKhpn9Gk7cvQ**; __utmb=95617934.1.10.1292859812; __utmc=95617934
響應:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
Content-Disposition: attachment; filename=DBSchema1.pdf
Pragma: public
Cache-Control: cache
Content-Type: application/pdf
Transfer-Encoding: chunked
Date: Mon, 20 Dec 2010 15:49:00 GMT
Contents of file
http://blog.thekieners.com/2010/04/21/opening-an-microsoft-office-documents-with-silverlight/ http://msdn.microsoft.com/en-us/庫/ ms775148(v = vs.85)的.aspx – PhilBrown 2010-12-20 16:13:14