node-ftp icon indicating copy to clipboard operation
node-ftp copied to clipboard

An FTP client module for node.js

Results 101 node-ftp issues
Sort by recently updated
recently updated
newest added

Error font when recieve data

[{"_id":"66ee23380657df8c67050d29","body":"Hi @actiontwo,\r\n\r\nTry this: `new Buffer(item.name, 'ascii').toString()`","issue_id":1714357015223,"origin_id":349379329,"user_origin_id":6513388,"create_time":1512495141,"update_time":1512495366,"id":1726882616740,"updated_at":"2024-09-21T01:36:56.739000Z","created_at":"2024-09-21T01:36:56.739000Z"}] comment

``` { type: '-', name: 'Ãnh Nắng Cá»§a Anh - Anh Tú - Tập 12 The Voice - Giá»ng Hát Viá»t 2017.mp4', target: undefined, sticky: false, rights: { user: 'rwx',...

get() always returns empty / no data

[{"_id":"664009ff2308c3a903133f1b","body":"Hi @mkloubert, \r\n\r\nI was able to fix this by calling stream.resume() because in the get function there is a call to stream.pause() which ensures the data event is not fired (The data event is consumed by the write stream and if there is none the writestream thinks there is no data).\r\n\r\nWhen you take a look at the get function theres a call to stream.pause() (Which in fact is the socket unless you use the zcomp option).\r\n\r\nHeres my code (It's used inside the download function of my FTPClient class, callback, local_path and remote_file are parameters and current_path is a member variable)\r\n\r\n```\r\nclient.get(path.join(current_path, remote_file), function (err, stream) {\r\n if (err) {\r\n callback(err);\r\n } else {\r\n \/\/Wenn der Stream schlie\u00dft callback aufrufen\r\n stream.once('close', function () {\r\n busy = false;\r\n callback();\r\n }).on('error', function (err) {\r\n busy = false;\r\n callback(err);\r\n });\r\n\r\n var writestream = fs.createWriteStream(local_path);\r\n\r\n writestream.on('error', function (err) {\r\n callback(err);\r\n });\r\n\r\n \/\/Write file to local path\r\n stream.pipe(writestream);\r\n stream.resume();\r\n }\r\n });\r\n```\r\n\r\nThe funny thing is that the bug affected my download for small files so much that no data was written and there was a complete shutdown for large files.","issue_id":1714357015226,"origin_id":333910199,"user_origin_id":2837509,"create_time":1507049929,"update_time":1507049929,"id":1715472895056,"updated_at":"2024-05-12T00:14:55.055000Z","created_at":"2024-05-12T00:14:55.055000Z"},{"_id":"664009ff2308c3a903133f1c","body":"I also had this problem, but only when running inside a docker container. Locally (macOS) it always worked. On the (official node debian jessie) docker container, I needed to call `stream.resume()`.","issue_id":1714357015226,"origin_id":350021308,"user_origin_id":770621,"create_time":1512664311,"update_time":1512664311,"id":1715472895060,"updated_at":"2024-05-12T00:14:55.059000Z","created_at":"2024-05-12T00:14:55.059000Z"}] comment

When I try to download a file from FTP server, by using `get()` method, it pipes to a local file, but does not write data. My code looks like that:...

proper UTF-8 handling

[{"_id":"663fe7682cfd0d66a8066402","body":"I still prefer to check and only use utf8 if the server explicitly supports it. A slightly better way to handle the encoding might be to just do `source.setEncoding('binary')` or `source.setEncoding('utf8')` depending on the server. That way `data` events always get properly formed strings.\n","issue_id":1714357015235,"origin_id":131006416,"user_origin_id":54666,"create_time":1439537943,"update_time":1439537943,"id":1715464040914,"updated_at":"2024-05-11T21:47:20.914000Z","created_at":"2024-05-11T21:47:20.914000Z"},{"_id":"663fe7682cfd0d66a8066403","body":"I agree with you (@mscdex) and @AyrA. But for now, nothing happens ...\nI think it would be good to implement the code of @Ayra and add a variable \"encoding\" the options that allows you to manually set the encoding with a default value of \"binary\", not to break compatibility with an older application.\n\nIt would be really nice if it could be done quickly because for myself, I have to manually edit the package ... Thank you.\n","issue_id":1714357015235,"origin_id":137431692,"user_origin_id":2950561,"create_time":1441285191,"update_time":1441285228,"id":1715464040919,"updated_at":"2024-05-11T21:47:20.918000Z","created_at":"2024-05-11T21:47:20.918000Z"},{"_id":"663fe7682cfd0d66a8066405","body":"Hi, I'm really interested in proper UTF-8 support for this great node module. Any news wether this PR (#123 as well?) is going to be merged into master?\n","issue_id":1714357015235,"origin_id":138269739,"user_origin_id":2127801,"create_time":1441623520,"update_time":1441623520,"id":1715464040923,"updated_at":"2024-05-11T21:47:20.923000Z","created_at":"2024-05-11T21:47:20.923000Z"},{"_id":"663fe7682cfd0d66a8066406","body":"I've decided to go about this slightly differently in ebb0fabba7, which should be more efficient.\n\nCan you please test the master branch and let me know if that works for you all?\n","issue_id":1714357015235,"origin_id":138335793,"user_origin_id":54666,"create_time":1441643393,"update_time":1441643405,"id":1715464040926,"updated_at":"2024-05-11T21:47:20.926000Z","created_at":"2024-05-11T21:47:20.926000Z"},{"_id":"663fe7682cfd0d66a8066407","body":"I've tested current master (ebb0fabba77f987f2852fa178e18e7d8aff57d52) and it works fine for me.\n","issue_id":1714357015235,"origin_id":138482850,"user_origin_id":2127801,"create_time":1441702161,"update_time":1441702161,"id":1715464040929,"updated_at":"2024-05-11T21:47:20.929000Z","created_at":"2024-05-11T21:47:20.929000Z"},{"_id":"663fe7682cfd0d66a8066408","body":"@AyrA \nWhat's about changing in parser lib? There used \"buffer += chunk.toString(\"binary\")\" construction. May be it'll help.\n","issue_id":1714357015235,"origin_id":183824953,"user_origin_id":13825571,"create_time":1455428689,"update_time":1455428689,"id":1715464040932,"updated_at":"2024-05-11T21:47:20.932000Z","created_at":"2024-05-11T21:47:20.932000Z"},{"_id":"663fe7682cfd0d66a8066409","body":"Hi everyone. how are thing going now ? \nI see this issue isn't fixed for a long time.\n","issue_id":1714357015235,"origin_id":216730471,"user_origin_id":2065400,"create_time":1462330701,"update_time":1462330701,"id":1715464040937,"updated_at":"2024-05-11T21:47:20.936000Z","created_at":"2024-05-11T21:47:20.936000Z"},{"_id":"663fe7682cfd0d66a806640a","body":"it work for me ,resolve my problem,can you merge it to master?\r\n@mscdex ","issue_id":1714357015235,"origin_id":280589230,"user_origin_id":4743467,"create_time":1487320863,"update_time":1487320910,"id":1715464040941,"updated_at":"2024-05-11T21:47:20.940000Z","created_at":"2024-05-11T21:47:20.940000Z"},{"_id":"663fe7682cfd0d66a806640b","body":"Yeah, It work with me to, but no one merge to master","issue_id":1714357015235,"origin_id":349330810,"user_origin_id":7269516,"create_time":1512486225,"update_time":1512486225,"id":1715464040946,"updated_at":"2024-05-11T21:47:20.946000Z","created_at":"2024-05-11T21:47:20.946000Z"}] comment

This code properly handles UTF-8 server responses and prevents double encoding.

sftp support?

[{"_id":"663e20de4a8e87d14e0e5dd7","body":"Try this: https:\/\/github.com\/mscdex\/ssh2","issue_id":1714357015243,"origin_id":349259116,"user_origin_id":1855340,"create_time":1512469002,"update_time":1512469002,"id":1715347678468,"updated_at":"2024-05-10T13:27:58.467000Z","created_at":"2024-05-10T13:27:58.467000Z"}] comment

Hi, I am trying to connect to a sftp server, but I'm unable to, as this module doesn't have sftp support. Is there any plan that node-ftp will support sftp...

For example, in the method ``` list ```, both ``` path ``` and ``` useCompression``` are optional, but when I invoke the method by ``` ftp.list(void (0), true, ()=> {})...

Duplicated uploads

[{"_id":"663dd4d82308c3a90310f3bf","body":"I do not think you should close the FTP connection if you are watching it.","issue_id":1714357015254,"origin_id":338362340,"user_origin_id":1855340,"create_time":1508558966,"update_time":1508558966,"id":1715328216634,"updated_at":"2024-05-10T08:03:36.633000Z","created_at":"2024-05-10T08:03:36.633000Z"},{"_id":"663dd4d82308c3a90310f3c0","body":"Maybe it's not clear from my snippet but I am watching a local folder and then upload any new files being added to that folder. As it might be hours in between the connection needs to be closed.","issue_id":1714357015254,"origin_id":338384851,"user_origin_id":541531,"create_time":1508585165,"update_time":1508585165,"id":1715328216638,"updated_at":"2024-05-10T08:03:36.637000Z","created_at":"2024-05-10T08:03:36.637000Z"},{"_id":"663dd4d82308c3a90310f3c1","body":"The problem is to subscribe to the event every time you connected FTP. Bad way.","issue_id":1714357015254,"origin_id":338393882,"user_origin_id":1855340,"create_time":1508591890,"update_time":1508591890,"id":1715328216640,"updated_at":"2024-05-10T08:03:36.640000Z","created_at":"2024-05-10T08:03:36.640000Z"},{"_id":"663dd4d82308c3a90310f3c2","body":"Check this.\r\n\r\n```\r\nconst EventEmitter = require('events');\r\nconst fs = require('fs');\r\nconst Client = require('..\/lib\/connection');\r\nconst config = { ... };\r\n\r\nconst client = new Client();\r\nconst emitter = new EventEmitter();\r\nconst watchPath = '.\/__folder\/';\r\nconst uploadList = [];\r\n\r\nconst ready = () => client.cwd('\/keymaps\/', () => emitter.emit('connected'));\r\n\r\nclient.on('error', (err) => {\r\n console.error('ERROR: ', err);\r\n});\r\n\r\nclient.on('close', (err) => {\r\n console.error('CLOSE: ', err);\r\n});\r\n\r\nconst connected = () => {\r\n const upload = (filename, key) => {\r\n client.put(watchPath + filename, filename, (err) => {\r\n if (err) throw err;\r\n\r\n console.log('Uploaded: ', filename);\r\n delete uploadList[key]\r\n\r\n client.list((err, list) => {\r\n if (err) throw err;\r\n console.log(list);\r\n });\r\n });\r\n };\r\n\r\n uploadList.forEach(upload);\r\n client.end();\r\n};\r\n\r\nfs.watch(watchPath, { encoding: 'utf8' }, (eventType, filename) => {\r\n if (eventType === 'change') {\r\n uploadList.push(filename);\r\n emitter.emit('upload');\r\n }\r\n});\r\n\r\nclient.on('ready', ready);\r\nemitter.on('upload', (eventType, filename) => client.connect(config));\r\nemitter.on('connected', connected);\r\n```","issue_id":1714357015254,"origin_id":338402249,"user_origin_id":1855340,"create_time":1508595106,"update_time":1508595106,"id":1715328216643,"updated_at":"2024-05-10T08:03:36.643000Z","created_at":"2024-05-10T08:03:36.643000Z"},{"_id":"663dd4d82308c3a90310f3c3","body":"I hope I helped.","issue_id":1714357015254,"origin_id":338434369,"user_origin_id":1855340,"create_time":1508622026,"update_time":1508622026,"id":1715328216646,"updated_at":"2024-05-10T08:03:36.645000Z","created_at":"2024-05-10T08:03:36.645000Z"},{"_id":"663dd4d82308c3a90310f3c4","body":"I've just used another library that behaves as expected.","issue_id":1714357015254,"origin_id":338488282,"user_origin_id":541531,"create_time":1508687999,"update_time":1508687999,"id":1715328216649,"updated_at":"2024-05-10T08:03:36.648000Z","created_at":"2024-05-10T08:03:36.648000Z"},{"_id":"663dd4d82308c3a90310f3c6","body":"can you suggest what another library you have used because I am facing the same problem? ","issue_id":1714357015254,"origin_id":342124872,"user_origin_id":16208480,"create_time":1509968594,"update_time":1509968594,"id":1715328216653,"updated_at":"2024-05-10T08:03:36.653000Z","created_at":"2024-05-10T08:03:36.653000Z"},{"_id":"663dd4d82308c3a90310f3c7","body":"[jsftp](https:\/\/www.npmjs.com\/package\/jsftp)","issue_id":1714357015254,"origin_id":342263609,"user_origin_id":541531,"create_time":1509997445,"update_time":1509997445,"id":1715328216658,"updated_at":"2024-05-10T08:03:36.658000Z","created_at":"2024-05-10T08:03:36.658000Z"}] comment

I have a watcher on a folder that is supposed to upload all new files. ```JavaScript watcher.on('add', (pathAndFilename) => { logger.info(`File '${pathAndFilename}' was added`); ftpClient.on('ready', () => { ftpClient.put(pathAndFilename, pathAndFilename.split(path.sep).pop(),...

UTF-8 Problem while listing files

[{"_id":"66ee2335bd88b249120a0ad0","body":"Same problem :\/\r\n","issue_id":1714357015259,"origin_id":339118942,"user_origin_id":11475820,"create_time":1508876498,"update_time":1508876498,"id":1726882613659,"updated_at":"2024-09-21T01:36:53.658000Z","created_at":"2024-09-21T01:36:53.658000Z"},{"_id":"66ee2335bd88b249120a0ad1","body":"Use my repo: https:\/\/github.com\/icetee\/node-ftp","issue_id":1714357015259,"origin_id":340202790,"user_origin_id":1855340,"create_time":1509207927,"update_time":1509207927,"id":1726882613664,"updated_at":"2024-09-21T01:36:53.664000Z","created_at":"2024-09-21T01:36:53.664000Z"}] comment

Hi, While I'm listing files. ftp list not getting the file names correctly. My file name is "Eylül.txt" Im getting "Eylül.txt" I think there is a utf-8 problem. Is there...

FTPS on tls, using port 990

[{"_id":"6649bee64a8e87d14e199946","body":"Were you able to get an answer to this or figure it out? I am having a similar issue.\n","issue_id":1714357015264,"origin_id":241509593,"user_origin_id":18430941,"create_time":1471891386,"update_time":1471891386,"id":1716109030885,"updated_at":"2024-05-19T08:57:10.885000Z","created_at":"2024-05-19T08:57:10.885000Z"},{"_id":"6649bee64a8e87d14e199947","body":"True - same issues here. I also haven't found any docs on the `secureOptions` object we can set - or is there docs that I haven't found yet?","issue_id":1714357015264,"origin_id":276292991,"user_origin_id":1333704,"create_time":1485847505,"update_time":1485847675,"id":1716109030911,"updated_at":"2024-05-19T08:57:10.910000Z","created_at":"2024-05-19T08:57:10.910000Z"},{"_id":"6649bee64a8e87d14e199948","body":"Ok, sorry found docs: https:\/\/nodejs.org\/api\/tls.html#tls_tls_connect_options_callback","issue_id":1714357015264,"origin_id":276303356,"user_origin_id":1333704,"create_time":1485851312,"update_time":1485851312,"id":1716109030917,"updated_at":"2024-05-19T08:57:10.917000Z","created_at":"2024-05-19T08:57:10.917000Z"},{"_id":"6649bee64a8e87d14e199949","body":"\r\n**EDIT**: Still an issue in master, fixed in next comment\r\n\r\nAnyone find a solution?\r\nIf I use secure:true, it will finish the onconnect function, do nothing for a few minutes, emit end, and then emit close(had_err = false). It will never emit ready. Function reentry which emits ready is never run.\r\nIf I use secure: implicit, then I get a timeout while connecting to server.","issue_id":1714357015264,"origin_id":300244702,"user_origin_id":4229134,"create_time":1494351593,"update_time":1494355740,"id":1716109030924,"updated_at":"2024-05-19T08:57:10.924000Z","created_at":"2024-05-19T08:57:10.924000Z"},{"_id":"6649bee64a8e87d14e19994a","body":"I used the connection.js file from kellym's [fork ](https:\/\/github.com\/kellym\/node-ftp) (as suggested on reedit [here](https:\/\/www.reddit.com\/r\/node\/comments\/6a6j67\/ftp\/)) and it was able to emit a ready state with an error.","issue_id":1714357015264,"origin_id":300264794,"user_origin_id":4229134,"create_time":1494355638,"update_time":1494415703,"id":1716109030929,"updated_at":"2024-05-19T08:57:10.929000Z","created_at":"2024-05-19T08:57:10.929000Z"},{"_id":"6649bee64a8e87d14e19994b","body":"My issue was port 990 and using secure: implicit (implicit FTP over TLS). You can change it and use FTPES(explicit FTP over TLS) without reconfiguration of your ftp server. \r\nThe trick is to use port 21 for FTPES with secure: true and options below. \r\nsecure: true cannot work with port 990 at this point in time.\r\nsecure: implicit with port 990 does not work and even kellym's [fork](https:\/\/github.com\/kellym\/node-ftp) throws a protection level error for me.\r\n\r\nWorking Code:\r\n```\r\nvar Client = require('ftp')\r\nvar fs = require('fs')\r\n\r\nvar c = new Client();\r\nlet file = fs.createReadStream(path + filename)\r\nc.on('ready', () => {\r\n c.put(path + filename,\r\n '\/destination\/' + filename, (err) => {\r\n if (err) throw err;\r\n c.end()\r\n })\r\n })\r\n})\r\n\r\nc.connect({\r\n host: '999.999.999.999',\r\n user: 'user',\r\n port: 21,\r\n password: 'pass',\r\n secure: true,\r\n secureOptions: { rejectUnauthorized: false }\r\n});\r\n```","issue_id":1714357015264,"origin_id":300454955,"user_origin_id":4229134,"create_time":1494416029,"update_time":1494416029,"id":1716109030938,"updated_at":"2024-05-19T08:57:10.938000Z","created_at":"2024-05-19T08:57:10.938000Z"},{"_id":"6649bee64a8e87d14e19994d","body":"Nice Gander7 it works for me, thanks.","issue_id":1714357015264,"origin_id":331522577,"user_origin_id":19418084,"create_time":1506104196,"update_time":1506104196,"id":1716109030947,"updated_at":"2024-05-19T08:57:10.947000Z","created_at":"2024-05-19T08:57:10.947000Z"}] comment

Hello, I'm trying to connect using the implicit secure option with port 990. Here my configuration: ``` _connectionProperties.secure = true; _connectionProperties.secureOptions = { 'rejectUnauthorized': false }; ``` I've tried with...

How do you guys workaround such issue ? For some reason, I don't want to create a physical file and use the NodeJS Buffer instead. ``` const filename = '/in/remote_file.xml';...

I'm sure there are use cases out there other than mine but mine is that IBM z/OS mainframes allow submission of JCL jobs via FTP and the job id which...