I have a web application (ASP.NET/C#) for which I would need to download a pdf file from the Server to Client side by double clicking on a table row.
My idea was to use JQuery/Ajax to call a web service. The web service calls another web service (provided by an external partner) that returns a PDF file (just this format) as byte[].
I have read of several possibilities, where in almost all cases the file is saved on the server and then returned to the client via the HTTPContaxt.Current.Response. In other cases an URL is provided to the client side and then the client is redirected to an hidden iFrame with such an URL.
What is the best approach to deliver a pdf file to the client, so that she/he can have open or save it locally?
Thanks.
Usually I simply call an external page, with a simple javascirpt windows.open(“GetAttach.ashx?id=5”)
and then, in that handler, the code to return the pdf byte array will be