-1

In our webapp, user selects a PDF file using input element, we save the PDF file to indexedDB for further needs.

After a while, some users want to export the PDF file from the browser to their computers, just like downloading the file. We really have no idea how to do this. we assume it is doable, but can not find tutorial or demo code about it.

We have done our research, but most posts we found are about how to convert Blob to File, not really what we want. So they are not helpful at all.

Can you guys please give us some helps? Thanks

Erwin.H
  • 117
  • 1
  • 6
  • Since you said "some users want to export the pdf file": do you also want other users to have access to the file or only the one who uploaded it? Your question is a bit unclear about that. – schroffl Dec 25 '16 at 13:05
  • Files are Blob and you can convert a Blob to a File by using the File Constructor, but you don't need it. Have a look at this lib for a cross-browser way to make a Blob downloadable : http://eligrey.com/demos/FileSaver.js/FileSaver.js – Kaiido Dec 26 '16 at 00:56

1 Answers1

0

Have you tried making it downloadable with JS? I.e., escaping it with a mime-type.

This way, I mean

Community
  • 1
  • 1
JuanKman94
  • 112
  • 1
  • 7