Questions tagged [filestreamresult]

57 questions
0
votes
0 answers

How to pass getClass.getClassLoader().getResourceAsStream() value to FileOutputStream

I am using getClass.getClassLoader().getResourceAsStream("abc.txt") which returns of type Inputstream, to get the filepath which works fine. Now i need to pass the the filepath to streamresult but it has a constructor : StreamResult(new…
Coder17
  • 767
  • 4
  • 11
  • 30
0
votes
0 answers

Pass a model as parameter to FileStreamResult

I want to pass a model as parameter to FileStreamResult in my controller but I get null. This the controller file where I want to get my model in m [HttpPost] public FileStreamResult GETPdf(MarkModel m)// here i want value from my view…
0
votes
0 answers

File.ReadAllBytes not creating an exact copy of my PDF - changing my mailto: link url

I'm dynamically creating a PDF file using ABC PDF v8, then pushing that data to the screen using the File.ReadAllBytes method, then displaying it using MVC5's FileStreamResult from my controller. The problem is, one of the links on my PDF is a…
someguy0005
  • 125
  • 2
  • 12
0
votes
1 answer

Exception when sending file through Stream

I want to download a file directly from dropbox.I am able to retrieve the contents of a file which I want to download directly from dropbox.I am unable to send the file through stream to a browser. Following exception: An exception of type…
0
votes
0 answers

How to get the path of the download folder using FileStreamResult

I need to Log if a download was or not successful. In a case which I specify the destination path is so easy, the problem is when the destination path is the default "Download" folder specified in the Browser used. My code is something like this: …
minoyo
  • 85
  • 1
  • 3
  • 14
0
votes
0 answers

Displaying document from MVC by calling method from WCF service

I want to display document for specified Document Id. For this, I am calling WCF service from MVC project. In MVC project, in HomeController.cs FileStreamResult objFileStreamResult =…
Nands
  • 379
  • 3
  • 19
0
votes
1 answer

Why is my StreamResult not returning the whole files?

I have to serve large files (200-800MB) to the client from my controller. I tested FileStreamResult, but this class buffered the whole file in memory. This behavior is not good enough for my project. Further i testest the approach from here:…
user2482138
  • 120
  • 1
  • 10
0
votes
2 answers

MVC4 Redirect After File Download

I have an ActionResult method in my controller that returns a FileStreamResult for a download file scenario. After the file is downloaded, I would like to redirect the user to a different view. How can I best accomplish this?
Mike C
  • 1
  • 1
  • 4
0
votes
1 answer

Unable to access file from server through code

I had written a code to first get an SSRS report and write to excel and save in a folder on server , manipulate the same excel through code and then save it again and then render it in excel for download. The code was working fine but then suddenly…
Richa
  • 407
  • 1
  • 10
  • 22
0
votes
2 answers

MVC3 + Streaming images from the Database is causing very high CPU usage on my server

I have this site that streams images from the database (SQL2008), and I think it's the one causing the very high CPU usage on my server. The CPU usage is at least 60-90%. I am using MVC3 and below is the code in my Controller that sends the image to…
dmc
  • 807
  • 2
  • 10
  • 25
0
votes
2 answers

ASP MVC FileStreamResult OutOfMemoryException

I have a large zip file (500MB or greater) that I am reading into a MemoryStream and return as a FileStreamResult. However, I am getting a OutOfMemory Exception for files over 200MB. Within my Action I have the following code: MemoryStream…
user327999
  • 443
  • 1
  • 9
  • 21
-2
votes
1 answer

Is it possible to change the CanWrite property in a FileStreamResult's FileStream?

I want to try this in order to discard a possibility of why my code is not working as expected. Thanks in advance!
SantLev
  • 140
  • 3
  • 15
1 2 3
4