mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 246 forks source link

Put function fails to upload empty files and just gets stuck (callback isn't called) #196

Closed devkev16 closed 6 years ago

devkev16 commented 6 years ago

Hi guys,

I saw this repository is literally dead (no pull request merged in the last months) but I wanted to create this issue for other guys who use this module and just can't figure out why their uploads are stucking.

I have an async queue running with a worker function for file uploading (implementation of parallel upload to speed up the process) which relies on callbacks to automatically handle the queue concurrency. The problem I experienced is that the upload callback is never called for some files and so my queue never finishes. That took me several hours of debugging and banging my head against the wall.

I will try to fix the module, If I suceed I will post my fix here and create an pull request even if it doesn't get merged I think it will be useful for others.

devkev16 commented 6 years ago

It seems that this Issue only occurs if one uses an ReadStream for the first parameter of the put function. The problem doesn't occur if one just use a path string.

So make sure you use a path string if your uploads stuck!

ad-ab commented 6 years ago

Did you manage to resolve this issue?