asp.net - Problems with Response.TransmitFile, Response.End and IE -
I am developing an ASP.NET app that responds to the user at one point. Transmissions sends using the file.
This works fine on my god machine, and even when I put it on the test server, still works on two of them; Although one of the servers (W2K3) only works on Firefox, when I try IE7, I get an error like "Internet Explorer can not open the file (server name) on sendfile.aspx."
I have created a small inline ASPX page to do the problem again, here it is:
& lt;% @ page language = "c #"% & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Script language = "cs" run = "server" & gt; Zero Page_load (Object Sender, System.EventArgs E) {string filePath = @ "C: \ temp \ export.zip"; Response.ClearHeaders (); Response.ContentType = "app / zip"; Response.Clear (); Response.AppendHeader ("content-effect", "attachment; file name = export.zip"); Response.TransmitFile (filepath); Rispans.and (); } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; / Html & gt;
I have tried different things and I have seen that if I response End line (but AFAIK should be there, at least according to every sample code I search around the web)
Another issue I have seen which may be related Or I can not believe that if I
& lt; Html>, & lt; Head and gt;
and its closing tag.
I am scratching my head on this for some time, does anyone know how to do it?
Do not use feedback. the ending ();
Try
Response.TransmitFile (filepath); Rispans.and ();
In fact, after .NET 2.0, you get the
response. Transmission file (file path) should be used; Context.HttpApplication.CompleteRequest ();
Comments
Post a Comment