sergi/jsftp

550 : Cannot create a file when that file already exists.

Closed this issue · 5 comments

keel commented

when I upload dirs, I got this:

Error: 550 ./wwwroot/2015: Cannot create a file when that file already exists. 
    at Ftp.parse (/Users/keel/dev/hexo/node_modules/jsftp/lib/jsftp.js:257:11)
    at Ftp.parseResponse (/Users/keel/dev/hexo/node_modules/jsftp/lib/jsftp.js:174:8)
    at Stream.<anonymous> (/Users/keel/dev/hexo/node_modules/jsftp/lib/jsftp.js:146:24)
    at emitOne (events.js:77:13)
    at Stream.emit (events.js:169:7)
    at ResponseParser.reemit (/Users/keel/dev/hexo/node_modules/duplexer/index.js:70:25)
    at emitOne (events.js:77:13)
    at ResponseParser.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at ResponseParser.Readable.push (_stream_readable.js:110:10)
    at ResponseParser.Transform.push (_stream_transform.js:128:32)
    at ResponseParser.<anonymous> (/Users/keel/dev/hexo/node_modules/ftp-response-parser/index.js:65:12)
    at Array.forEach (native)
    at ResponseParser._transform (/Users/keel/dev/hexo/node_modules/ftp-response-parser/index.js:48:9)
    at ResponseParser.Transform._read (_stream_transform.js:167:10)
    at ResponseParser.Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:292:12)
    at writeOrBuffer (_stream_writable.js:278:5)
    at ResponseParser.Writable.write (_stream_writable.js:207:11)
    at Socket.ondata (_stream_readable.js:528:20)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)

there was already an dir existed, and how to skip mkdir or overwirte it?

keel commented

But FileZilla works fine. is there a way to force overwrite the dirs?

keel commented

And I found the error happened when the remote dir is pure numbers, like '2015' .

keel commented

OK, I Fix it myself , it's parse-listing's bug.
https://github.com/sergi/parse-listing/pull/8

sergi commented

Overwriting dirs is not a functionality found in the original FTP specification, and each server implements it differently. You can always add this functionality on top of the library in your code.

Cheers!

keel commented

Thanks !