filestreamresult

ASP.NET MVC FileStreamResult not working as intended

I have the following code which I stripped out of any non-essential lines to leave the minimun reproducable case. What I expect is for it to return the image, but it doesn't. As far as I can see it returns an empty file: public ActionResult Thumbnail(int id) { var question = GetQuestion(db, id); var image = new Bitmap(question.I...

asp.net mvc serving txt gets truncated

Hello, I'm trying to serve a txt file made from the database using an action. The action is the following: public ActionResult ATxt() { var articulos = _articulosService.ObteTotsArticles(); return File(CatalegATxt.ATxt(articulos), "text/plain"); } and the CatalegATxt class is: using System; using System.Collections.Generic; u...

XML + Write to Relative Path

I have the following folder structure TempProj !-js !-jsp !-WEB-INF !-classes !-lib Inside my lib folder, I have a java file that creates an XML file, I actually need the file to be generated inside the jsp folder. I'm creating using StreamResult result = new StreamResult("test.xml"); I've tried giving the following paths "../....

ASP.Net MVC FileStreamResult, valid chars for FileDownloadName

Hi, I have an action method that returns a FileStreamResult, the download works fine, the problem is that although I set the FileDownloadName property of the result object, some of the files are downloaded with another name (specifically the last part of the address of the page I'm working on. e.g. in the page "http://localhost:5479/Ite...