response.transmitfile

Problems with Response.TransmitFile, Response.End and IE

五迷三道 提交于 2020-01-01 12:32:24
问题 I am developing an ASP.NET app which at one point sends a file to the user, using Response.TransmitFile. It works fine on my dev machine, and when I deploy it to the test servers it still works on two of them; in one of the servers though (W2K3) it only works on Firefox, when I try it on IE7 I get an error like "Internet Explorer cannot open file sendfile.aspx on (server name)". I've created a small inline aspx page to repro the problem, here it is: <%@ Page Language="C#" %> <html><head>

Efficiently sending files from asp.net core

帅比萌擦擦* 提交于 2019-12-23 15:38:15
问题 I am interested in porting some code to ASP.NET Core and wanted to know the most efficient way to send files, aka "download" files, from an ASP.NET Core web service. With my old ASP.NET code, I was using a FileStream: var content = new FileStream( myLocation, FileMode.Open, FileAccess.Read, FileShare.Read); var result = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StreamContent(content) }; However, I was trying to find the .NET equivalent of FreeBSD's sendfile() and found

Using Response.TransmitFile for physical file not working

我们两清 提交于 2019-12-12 14:29:23
问题 I am trying to user the Response.TransmitFile() to prompt a download. I have read a number of posts on the issue and based my method off Rick Strahl's blog http://www.west-wind.com/weblog/posts/76293.aspx The only difference (that I can tell) is that I am targeting a physical file outside of the virtual directory. This code is called in an ajaxified radgrid... I wonder if the response.transmitfile doesn't work with ajax calls? Here is my code snippet: // Get the physical Path of the file

Problems with Response.TransmitFile, Response.End and IE

南楼画角 提交于 2019-12-04 11:09:08
I am developing an ASP.NET app which at one point sends a file to the user, using Response.TransmitFile. It works fine on my dev machine, and when I deploy it to the test servers it still works on two of them; in one of the servers though (W2K3) it only works on Firefox, when I try it on IE7 I get an error like "Internet Explorer cannot open file sendfile.aspx on (server name)". I've created a small inline aspx page to repro the problem, here it is: <%@ Page Language="C#" %> <html><head> <script language="CS" runat="server"> void Page_Load(object sender, System.EventArgs e) { string filePath =

Response.TransmitFile and delete it after transmission

你离开我真会死。 提交于 2019-12-01 03:47:08
I have to implement GEDCOM export in my site. My .net code created one file at server when export to gedcom clicked. Then I need to download it to client from server, as well as user should be asked where to save that file, meaning savedialog is required. After it's downloaded, I want to delete that file from server. I got one code to transmit file from server to client: Response.ContentType = "text/xml"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName); Response.TransmitFile(Server.MapPath("~/" + FileName)); Response.End(); from this LINK but I am not able to

Response.TransmitFile and delete it after transmission

让人想犯罪 __ 提交于 2019-12-01 00:39:04
问题 I have to implement GEDCOM export in my site. My .net code created one file at server when export to gedcom clicked. Then I need to download it to client from server, as well as user should be asked where to save that file, meaning savedialog is required. After it's downloaded, I want to delete that file from server. I got one code to transmit file from server to client: Response.ContentType = "text/xml"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName);