I'm working on an ASP.NET MVC App that has buttons that have the server return an rdp file, which is created by my business layer.
What I want is to be able to have the server create this rdp file, then serve it, without having it stored on disk.
What would be the best way to go about this?
Thanks.
You can create the file in a MemoryStream and then serve it by using Response.Write
Also don't forget to set the ContentType to "application/rdp"
Edit: As Danny Chen suggested you can use FileStreamResult
in the controller class
Stream stream = new MemoryStream();
//Fill the stream here
return new FileStreamResult(stream,"application/rdp")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With