0

Right now I'm facing the issue how to download requested file from server. Api is sending the value as base64 string file

{
 Document: "JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0a...",
 FileName: "file.pdf"
}

How can I save the pdf file? Thanks

Shaxrillo
  • 769
  • 1
  • 7
  • 24
  • 1
    A hint for your search: that `Document` string is the content of the PDF encoded using "base64". You tagged this with JavaScript and ASP.NET. Which language do you want answers in? – Heretic Monkey Mar 25 '18 at 15:54
  • Note that for JavaScript, [Create a file in memory for user to download, not through server](//stackoverflow.com/q/3665115) answers the question pretty handily. – Heretic Monkey Mar 25 '18 at 15:55
  • And for .NET, [Base64 encoded string to file](//stackoverflow.com/q/1588306) has an answer. – Heretic Monkey Mar 25 '18 at 15:56
  • @MikeMcCaughan Thanks for the response. I'm using the webfunction server and when I request from javascript to the api functions it returning this value in order to download no idea how can I download this as pdf file – Shaxrillo Mar 25 '18 at 16:01
  • 1
    I have no idea what "webfunction server" is, but the first link I shared shows how to convert that string to a file for download. – Heretic Monkey Mar 25 '18 at 16:04

0 Answers0