Questions tagged [response.transmitfile]
20 questions
9
votes
1 answer
Efficiently sending files from asp.net core
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(
…

Brandon Petty
- 605
- 1
- 6
- 15
9
votes
2 answers
Response.TransmitFile and delete it after transmission
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…

Radhi
- 6,289
- 15
- 47
- 68
8
votes
5 answers
Repsonse.Transmitfile(); Able to Save but cannot Open
I'm trying to send an xlsx file by using
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType =…

Marcus
- 5,407
- 3
- 31
- 54
8
votes
7 answers
Response.TransmitFile Not downloading, and throwing no Errors
I'm currently using a HttpResponse to download files from my Server. I already have a couple functions being used to download Excel/Word files, but I'm having trouble getting my simple Text file (.txt) to download.
With the text file I'm basically…

Lando
- 2,288
- 8
- 33
- 46
5
votes
1 answer
Why does IIS7 ignore my content-type header when I use ASP.NET to stream files?
I have a simple web site with two pages. One displays a list of files, and the other streams a file when it's clicked in the list. All was fine in production for 6 months, but now I have to move the site to Windows 2008/IIS7. I have it mostly…

John Price
- 53
- 1
- 4
4
votes
3 answers
Problems with Response.TransmitFile, Response.End and IE
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…

rodbv
- 5,214
- 4
- 31
- 31
3
votes
0 answers
Why doesn't Response.TransmitFile return my file in my WCF service?
If you could explain me why TransmitFile ain't working, code is simple, I create excel file (.xlsx), save it on server and return file path (via CreateProjectsReport), and then I just want to take file and transmit it to user ....
string filePath =…

Veljko89
- 1,813
- 3
- 28
- 43
3
votes
2 answers
Using Response.TransmitFile for physical file not working
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…

Matthew
- 10,244
- 5
- 49
- 104
3
votes
1 answer
TransmitFile with filename containing spaces
In C# ASP.Net Website, to transfer the file to client I am using
String file_path = Server.MapPath("~/files/"+file_name);
HttpContext.Current.Response.ContentType =…

Prasad Jadhav
- 5,090
- 16
- 62
- 80
2
votes
1 answer
Pass a request back to IIS inside a ActionResult
I'm pretty sure the answer is "you can't do this", but if so, ASP.NET MVC is horribly flawed.
I have an ActionResult which needs to serve a static file (the filename is determined in code). For performance reasons (and because I don't feel like…

Lilith River
- 16,204
- 2
- 44
- 76
2
votes
1 answer
.net File Download on Mac only get .JPEG appended
I've got a legacy app that allows upload and download of files. The files are stored on disc the files names in a SQL database. To allow duplicate files names from the users, the database store the user original file name and a unique name. The…

RichP
- 525
- 1
- 10
- 25
2
votes
1 answer
Transmitting Zipped file from server in .Net
I am writing a small web app and part of the functionality is to be able to download the logs from the server to the user's file system. I am able to zip the existing logs, but am failing to get the zipped folder to transmit. I have browsed many…

Justin
- 154
- 1
- 17
2
votes
8 answers
how to transmit a zip file from c# code
I am using c#.net application in which I need to download a zip file using c# codebase.I am using the following code for downloading the file:
Response.ContentType = "application/zip" …

asd
- 65
- 2
- 3
- 8
2
votes
1 answer
Why are files are different when downloading from an ASP.NET (AJAX download with Blob)
Using MVC 4.0, I have used the following code to create a download files from the server from an ajax source (using the latest firefox):
This works fine if the output involves are textual files such as csv or txt files, however, when it comes to…

user3034931
- 152
- 3
- 12
1
vote
1 answer
Open jpg/pdf in new window
When I tried to open a file in new window using the code below, it is downloading the document instead of opening in new window. When I open the downloaded document, it looks good.
But I want the document to be open in new window. Thanks for your…

Harish
- 193
- 1
- 3
- 14