jsPDF file is saved without any extension
See original GitHub issueSupport plan
- Community,
- no
- no
Context
- node version: 14.15.4
- module (formidable) version: 1.2.2
- environment (e.g. node, browser, native, OS): AWS ubuntu
- used with (i.e. popular names of modules):
- any other relevant information: I am using React.js .
What are you trying to achieve or the steps to reproduce?
//Nodejs
const newPath = files.autoPdf.path
//Also tried this... It saves the string to mongodb with extension... But the file gets saved without any extension.
const newPath = `${files.autoPdf.path}.pdf`
//React.js
const pdf = new Blob([this.state.doc.output("blob")], {
type: "application/pdf",
});
File without any extension
# File with extension
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
jsPDF saving the file without extension when sent to nodejs ...
This works fine. It saves the file with .pdf extension. Now the problem is that I am sending this file to the express.js...
Read more >jsPDF - Documentation - GitHub Pages
jspdf.js, line 3163. Consumes the current path without any effect. Mainly used in combination with clip or clipEvenOdd. The PDF "n" ...
Read more >Generating PDFs from Web Pages on the Fly with jsPDF
Massimo Cassandro demonstrates how to make use of jsPDF, a JavaScript library for generating PDF documents from web pages.
Read more >How to render a PDF generated with jsPDF in a LWC
1 Answer 1 · You can get Pdfjs here · Once you download it, load that as a Static resource in Setup >...
Read more >jspdf generate pdf file in browser in javascript - YouTube
Get the full source code of application ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
const pdf = new File([this.state.doc.output(“blob”)], “myTest1.pdf”, { type: “application/pdf”, });
formData.append(“autoPdf”, pdf);
SOLVED! Thanks, man!
Blob does not have a name You need to use https://developer.mozilla.org/en-US/docs/Web/API/File/File Create a file instance with the blob, and there you can give it a name with the extension. Then put the file in the formData