1

I have an application that creates a PDF document based on user input. I now have to use this PDF and return this from a web service to serve a different application. Is there any way to do that from a web method. Because I am not able to return a File from web method all I can do is return a FileStream.

Thank you.

Skanda
  • 131
  • 4
  • 14
  • You can always turn the filestream into a base64-encoded string which the client can un-encode and write to a file on their side. – Captain Kenpachi Sep 02 '20 at 12:17
  • Has the PDF document been written to disk (you could use [Response.TransmitFile](https://learn.microsoft.com/en-us/dotnet/api/system.web.httpresponse.transmitfile)) or is it in memory ([How to download memorystream to a file?](https://stackoverflow.com/questions/16558317/how-to-download-memorystream-to-a-file) – Andrew Morton Sep 02 '20 at 12:41
  • @AndrewMorton PDF file is first saved on to a directory and then I want to return that from a method in web service. – Skanda Sep 02 '20 at 17:06

0 Answers0