question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicated uploads

See original GitHub issue

I have a watcher on a folder that is supposed to upload all new files.

watcher.on('add', (pathAndFilename) => {
  logger.info(`File '${pathAndFilename}' was added`);

  ftpClient.on('ready', () => {
    ftpClient.put(pathAndFilename, pathAndFilename.split(path.sep).pop(), (error) => {
      if (error) {
        logger.error(`Error transferring over FTP '${pathAndFilename}'`, error);
      } else {
        logger.info(`File successfully transferred over FTP '${pathAndFilename}'`);
      }
      ftpClient.end();
    });
  });

  ftpClient.connect({
    host: ftpHost,
    port: ftpPort,
    user: ftpUser,
    password: ftpPassword,
  });
})

Every time a new file is being uploaded the FTP reuploads the previous ones. i.e.

start ftp
add `file1` -> ftp uploads `file1`
add `file2` -> ftp uploads `file1`, `file2`
add `file3` -> ftp uploads `file1`, `file2`, `file3`
...

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
iceteecommented, Oct 21, 2017

I hope I helped.

0reactions
the-noobcommented, Nov 6, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to perform Bulk Upload and duplicate entries are ...
The issue occurs because dataset name is a unique entry in the bulk upload file. Therefore, any duplicate entry results in a Duplicate...
Read more >
Images I upload to Media Library are being duplicated ...
I've just uploaded a test image and it didn't duplicate this time – the uploads don't duplicate in every instance. (To clarify, there...
Read more >
Best way to avoid duplicated files. - Cloudinary Support
Hi, I'm trying to find the best way to avoid duplicate files, ... for me. the file takes the same time when is...
Read more >
Detect Duplicate Files When Uploading - Flywheel.io
This article explains how to find duplicate files when using the CLI to upload data. Detecting Flywheel Duplicates. Flywheel scans both the ...
Read more >
Remove or report duplicate businesses from bulk uploads
Report duplicate locations on Google Maps · On your computer, open Google Maps. · Select the location you want to report as a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found