the docs here indicate an overwrite option:
overwrite (Boolean) - Whether to overwrite existing resources with the same public ID. When set to false, return immediately if a resource with the same public ID was found. Default: true.
When I set it to false, the files still upload all their data. This seems to be an error.
cld.uploader.upload(filePath, function(result) {
if (result.error) {
return done(result.error);
}
done();
}, {
// Note these are the upload options.
resourcetype: 'auto',
publicid: publicId,
overwrite: false,
});