overwrite: false not working in Node.js
Hi, the docs here indicate an overwrite option:
http://cloudinary.com/documentation/upload_images
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.
resource_type: 'auto',
public_id: publicId,
overwrite: false,
});
-
Hi Michael,
Sorry for the very late reply, we have noticed that this request was left unattended. I guess this is not relevant anymore but for future reference -
If the `overwrite` flag is `false`, then if an image with the given public_id is already present, the upload doesn't take place.
Note that we don't return an error message in such cases, we return the already uploaded image's details, alongside with an additional parameter (`"existing" => true`) which indicates that there was already an image stored on your account, and that means that the upload wasn't processed.
Thanks,
Itay
0
Post is closed for comments.
Comments
1 comment