FTP - Check for file in nodejs

Asked

Viewed 197 times

0

I have a folder on a server, accessible via FTP. I would like to know a form in NODEJS where passing the file name, it returns me if the file exists or not. I found an implementation in DELPHI - code

  • There are several FTP Client modules for Node.js. What you can do is implement some, try to give a Get in the file you want and the return will indicate whether it exists or not.

  • The problem I found was two: if you use a list, the folder is large and can break the parser, bringing inconsistency. If I implement the code and ask for the file, the system already starts the download. So my idea was to find out if there is any paramentro, either ftp or Curl where I passing the name it return me a 200 or 404...

  • Include in your question the code you have already developed and tell which Node module you are using for the FTP client. 200 or 404 are protocol status HTTP, I’m not sure if the codes from FTP are the same.

  • I just found a code in PHP http://codigosnaweb.com/forum/Verificar-se-um-arquivo-existe-em-um-servidor-remoto-curl-PHP_1_10027.html . I noticed that the development used a function to return the answer code. I think it may be a path...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.