atinux / node-ftps

FTP, FTPS and SFTP client for node.js, mainly a lftp wrapper.
MIT License
202 stars 57 forks source link

get file into variable #62

Open hershyheilpern opened 6 years ago

hershyheilpern commented 6 years ago

how can i get the downloaded file into a variable
and upload a file from a variable

hardy925 commented 6 years ago

This is not an issue, but a how-to question. It's probably better to ask on stackoverflow or some other network.

  1. Use ftps.get() to retrieve the file, use node fs to read the downloaded file into a variable
  2. Use node fs to stream the variable contents into a file, use ftps.put() to upload the newly created file to the server.

Both of these should consider async await with promises or npm-async with callbacks