Questions tagged [fileresult]
74 questions
0
votes
1 answer
The resource cannot be found
i have following action not return a View
public FileResult Download(int? id)
{
var files = from p in _db.tbl_Pdfs
where p.PaperId == id
select p.FileName;
var archive =…

mina a.beigi
- 122
- 3
- 13
0
votes
1 answer
the name file does not exist in current context in signal r Hub class
This is my GetFileData with return type FileResult so it should return a file:
public FileResult GetFileData(int fileId)
{
var file = db.Files.Single(x => x.Id == fileId);
return File(file.Content, file.ContentType);
…

duke
- 1,816
- 2
- 18
- 32
0
votes
1 answer
Save file with prompt 'Save as...' using FileResult
I need to download specific files when clicking on some text. I expect the typical 'Save as..' dialog to choose where I would to save the file, but it doesn't appear. The request and the response are OK.
Request/Response header
GET…

blfuentes
- 2,731
- 5
- 44
- 72
0
votes
1 answer
First run FileResult to download file, then RedirectToAction
This will send an email when a button gets pushed. However I am trying to call the FileResult, SaveDocument, to download a file right before redirecting back to the button page.
I am using a hardcoded file for now to download for the sake of…

JustJohn
- 1,362
- 2
- 22
- 44
0
votes
1 answer
FilePathResult doesn't work for swf files?
I'm using FileResult to show files in my web site as the following:
public ActionResult GetSwf(long id = 0)
{
if (id <= 0) return null;
Attachment attachment = Service.GetAttachmentById(id);
if (attachment == null) return null;
…

Mohammad Dayyan
- 21,578
- 41
- 164
- 232
0
votes
1 answer
Weird file download behavior in ASP.NET MVC application
I have an action method in my MVC app which returns a FileResult based on a file saved as a blob in the database. The root problem is that for some file types, requesting the file returns an empty file, even though I've verified that the database…

Tomas Aschan
- 58,548
- 56
- 243
- 402
0
votes
1 answer
Can I call FileResult from a Void Function in MVC 2?
I have a void Function and I need to return a FileResult or call a FileResult action from this void function. Is there any way that this can be done?

user3579974
- 13
- 7
0
votes
1 answer
Downloading/Opening Excel File with FileResult MVC4 Not Working
I am trying to open an excel file on local disk in Excel using the FileResult object. When i click the file to open, it downloads the file which is named the same as my ActionResult(WTF?), and it brings up the "choose program" window when i click…

user1732364
- 925
- 4
- 28
- 58
0
votes
1 answer
MVC 4: How to create visual Indicator while FileResult Action generates PDF to be sent back to browser?
I have FileResult Controller Action that can take a couple minutes to run under some circumstances. I would like to provide our users a visual indication that the Action is running, such as a message, a spinner, or a progress bar. The trouble is,…

campbelt
- 1,573
- 5
- 27
- 43
0
votes
1 answer
how to generate path to file with mvc4
Looking to know what best practice is for the following. I am running an asp.net mvc 4 site.
I have 2 static PDF documents that a user to my site can download. The path to the documents are based on different criteria. I have 3 options to generate…

amateur
- 43,371
- 65
- 192
- 320
0
votes
1 answer
FileResult is not prompt in mvc3
I create MVC 3 application in vs 2010. I try to a download a file in the filder.
this is my Action in MVC. Please see my code.
//[HttpPost]
public FileResult Download(string url, string cnt)
{
if (!string.IsNullOrEmpty(url) &&…

Ragesh P Raju
- 3,879
- 14
- 101
- 136
0
votes
2 answers
How to download file PDF using FileResult but "only" via $ajax request?
This is the web method definition:
[HttpPost]
public FileResult GenerateReport(string Id) {
//............Code .................//
return File(response.ReportContents, "application/pdf");
}
and here is my jQuery ajax call to web…

Hau Le
- 667
- 2
- 17
- 42
-1
votes
1 answer
How to return any type of file from MVC action method?
I am saving the uploaded file content as byte array with file extension in database. I wanted to use file result which returns any type of file. How can i achieve it ?
I tried with image file. Can i do like below code for all types ? will that works…

vinoth kumar
- 216
- 4
- 15
-1
votes
1 answer
How to binary data to PDF file ASP.NET MVC
I develop a student information system.I inser the PDF file to the database as a binary for each course.I want users to download this file.Downloading file but not displaying.Where am I doing wrong.
MvcCode
public FileResult FileDownload(Ders…

Onur Önder
- 311
- 1
- 7
- 20