biddster/node-red-contrib-ftp-server

Errors if tries creating subfolders

Closed this issue · 10 comments

joxta commented

My IP cam seems to send other commands to the ftp server before saving an image, as it tries to add a couple of subfolders, which I cannot stop it doing
The console gives me:

7 Oct 01:10:12 - [info] [ftp-server:IPCAM FTP Svr] Connected as user: ftp_cam
7 Oct 01:10:12 - [info] [ftp-server:IPCAM FTP Svr] stat: /20171007/images/
7 Oct 01:10:12 - [info] [ftp-server:IPCAM FTP Svr] Finished - stat: /20171007/images/
ERROR: CWD /20171007/images/: Error: ENOENT: no such file or directory, stat '/20171007/images/'

Any ideas on how this could be fixed?

Hi @joxta. What version of this node are you using. I made a whole bunch of changes to support folder creation. It should work.

Nope - it's a bug, just amended my test case to operate as per your example. Thanks for the report.

@joxta does your camera not try to do a mkdir after the stat returns ENOENT? That's what I've observed with other cameras.

joxta commented

@biddster , I've had a bit more of a look with the help of some FTP software, and it appears to try the following:
CWD to a folder within a folder (which fails)
XMKD the first folder that doesn't exist
XMKD the sub folder within the first folder
CWD again - if it still fails, it gives up.

Does that help at all?

Also, how can I update my nodes to your new code for testing? Do I have to wait until npm is updated?

Yes, that helps @joxta. Many thanks.

I'll try to get a bug fix release to you via npm this week.

It might take a few attempts to get it right for you.

joxta commented

Hi,
Just wondered if you had got a version over to npm yet for me to test?

Thanks

Sorry - no, had a busy couple of weeks. I'll push it now.

Done - 0.2.2 released. Fingers crossed!

joxta commented

I can confirm that after updating and restarting node-red, it now works as expected.
Thanks very much

You're very welcome. Thanks for the feedback. Much appreciated.