Question

I am generating a file on the server and I do not want to write it to disk but instead return it to the client via a web service. What recommendations would you have to do this?

Was it helpful?

Solution

Response.OutputStream.Write(...)

Or if you have a MemoryStream:

MemoryStream ms = ...;
ms.WriteTo(Response.OutputStream);

Edit:

If it's a SOAP web service, then just return a byte array from your web service method in your asmx.cs file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top