0

I'm using Node, along with express, Jade and a MongoDB. So far I'm able to query the database and display the data in a webpage.

In the database I am storing PDFs and I would like to be able to download these from the webpage. I can currently get the pdf data in the form of a string (of random character) and display them on a webpage but I'd like to have a button where the user can download it as a pdf.

To insert the pdf into the db I the below python code to open it and pyMongo to insert it.

file = Binary(open(filePath, "rb").read(), 0)

Thanks in advance.

1 Answers1

0

This has little to do with the technologies you mention, but how you handle data on the client. Essentially you will need to utilise frontend JavaScript, HTML and how the browsers handle those in conjunction with data. A pointer would be here https://stackoverflow.com/a/39515978/3580261

eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61