inovozenko
inovozenko
@zirt0, I had the same problem with bad decoding of base64 on server side. Resolved problem this way (encode `pdfBase64`before sending to the server): ` return $.ajax({ url: 'send-email.php', type:...
@nfinfu, this way: ``` function sendPdf() { pdfDocGenerator = pdfMake.createPdf(yourConfig); return new Promise(function(resolve, reject) { pdfDocGenerator.getBase64(function (pdfBase64) { resolve(pdfBase64); }); }); } ```
@nfinfu, You should not create pdfMake-object. Only include pdfmake.js library, and this object will be global.
@pnramya ``` upload(req, res, function (error) { console.log(req.body); //
@pnramya Or ``` const storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, '/tmp'); }, filename: function (req, file, cb) { console.log(req.body); //
@noemi-dresden Hi First of all you should send some param on client-side: `form.append('my-param', 'my-value');` And then receive it on NodeJS-side: `upload(req, res, function (error) { console.log(req.body); //