Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftp.get() not working correctly #304

Open
alimsahy opened this issue Aug 12, 2019 · 7 comments
Open

ftp.get() not working correctly #304

alimsahy opened this issue Aug 12, 2019 · 7 comments

Comments

@alimsahy
Copy link

When I try to download the file with the get method, it downloads the file but the file appears to be 0 kb. Is there something I did wrong?

function downloadUpdates()
{
        return new Promise((resolve, reject) =>
            {
                if (filesToUpdate.length > 0)
                {
                    filesToUpdate.forEach(file =>
                    {
                        var fileName = file.split('/').pop();
                        var filePath = file.replace(fileName, '');
                        var localPath = application.getAppPath() + '/files' + file.replace(ftpPath, '');
                        
                        console.log(fileName);
                        console.log('Download Destination: ' + localPath);
                        console.log('Remote location: ' + file);

                        ftp.get(file, localPath, (err) =>
                        {
                            console.log('Downloading..');
                        });
                    });
                    resolve(true);
                }
                else
                {
                    reject(false);
                }
            });
        }

Result:
image

@thesuhu
Copy link

thesuhu commented Sep 5, 2019

i have the same issue, download file get 0 KB. it's work fine on Node version 9.0.5

@JonathanChaochen
Copy link

same issue after upgrade node from V8.15.1 to V12.11.1 and got errno: 'ECONNRESET'

@sdnetwork
Copy link

same issue after upgrade node from v9 to v10

@JonathanChaochen
Copy link

So after all. I am using basic-ftp. It works well. recommend to others if have the same problem but still want to use a similar ftp package.

@sanjitdev
Copy link

Any update on this issue @sergi?

@lingaoliu105
Copy link

Thanks @JonathanChaochen i tried basic-ftp and it works. Don't recommend using this lib. Those weird issues wasted me a lot of time

@thesuhu
Copy link

thesuhu commented Mar 25, 2023

For who want to work with sftp, you can use this package, easy to use:

https://www.npmjs.com/package/mysftp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants