sergi/jsftp

delete file / folder function

lucav90 opened this issue · 1 comments

hi,

there is the function to delete a folder or a file?

In case anyone else ends up on this ticket, a raw call with dele is the one that worked for me. If you like promises, here's mine:

const deleteFileFromFTP = (fileName) =>
  new Promise((resolve, reject) =>
    Ftp.raw('dele', fileName, (err) => {
      if (err) return reject(err)

      return resolve()
    }),
  )

I found dele on this list of ftp commands: https://www.nsftools.com/tips/RawFTP.htm