Open 18772894357 opened 5 years ago
ftp.on('ready', () => { ftp.size(filename, (err, size) => { ftp.get(filename, (err, stream) => { res.writeHead(200, { 'Content-Type': 'application/force-download', 'Content-Disposition': 'attachment; filename=' + filename, 'Content-length': size }); stream.pipe(res); stream.once('close', function() { ftp.end(); }); }); }) })
ftp.on('ready', () => { ftp.size(filename, (err, size) => { ftp.get(filename, (err, stream) => { res.writeHead(200, { 'Content-Type': 'application/force-download', 'Content-Disposition': 'attachment; filename=' + filename, 'Content-length': size }); stream.pipe(res); stream.once('close', function() { ftp.end(); }); }); }) })