jsftp icon indicating copy to clipboard operation
jsftp copied to clipboard

Error when reading file with spaces

Open coderade opened this issue 6 years ago • 2 comments

When I try to read a file with spaces on the name, like the following example:

let filePath = 'TEST_FILE 2018-04-02.csv';
FtpClient.get(filePath, (err, socket) => {
        if (err) {
          console.warn(err);
          return;
        }
}

I'm receiving the error:

Error: 550 Failed to open file. at Ftp.parse (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/jsftp/lib/jsftp.js:223:11) at Ftp.parseResponse (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/jsftp/lib/jsftp.js:146:8) at Stream.pipeline.on.data (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/jsftp/lib/jsftp.js:112:10) at Stream.emit (events.js:180:13) at ResponseParser.reemit (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/duplexer/index.js:70:25) at ResponseParser.emit (events.js:180:13) at readableAddChunk (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/ftp-response-parser/node_modules/readable-stream/lib/_stream_readable.js:195:16) at ResponseParser.Readable.push (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/ftp-response-parser/node_modules/readable-stream/lib/_stream_readable.js:162:10) at ResponseParser.Transform.push (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/ftp-response-parser/node_modules/readable-stream/lib/_stream_transform.js:145:32) at ResponseParser.<anonymous> (/home/coderade/repo/work/rumo/Supervisorio/nodejs_gateway/node_modules/ftp-response-parser/index.js:62:12) {code: 550, stack: Error: 550 Failed to open file. at Ftp.parse (…/node_modules/ftp-response-parser/index.js:62:12), message: 550 Failed to open file.}

There is any way to escape this? Is this the expected behaviour?

coderade avatar Apr 02 '18 13:04 coderade

Did you fix it?

nitti87 avatar Sep 01 '21 12:09 nitti87

i am having this same issue when i try to fetch files with space like "MyFOlder (1)"

princevora avatar Apr 18 '24 09:04 princevora