2

Am trying to upload or send a base64 PDF file (with e-sign) to FTP using nodejs ftp. the point here is that I can upload the file to ftp but am losing the e-signs on the file;

const Client = require('ftp');

function (path, fileName,file) {
     return new Promise((resolve, reject) => {
        let c = new Client();
        c.on('ready', function () {
            c.append(file, path + '/' + fileName, function (err) {
                if (err) {
                    reject('Upload exception');
                }
                c.end();
                resolve();
            });
        });
        c.connect({
            host: process.env.FTP_HOST,
            port: parseInt(process.env.FTP_PORT, 10), 
            user: process.env.FTP_USER, 
            password: process.env.FTP_PASSWORD
        });
    }).catch(error => {
        reject(error);
    });

}

to remind you that am sure the base64 signed pdf file is working well before loading it to ftp and all signatures are valid.

MuhanadY
  • 752
  • 1
  • 12
  • 40

0 Answers0