0
var uploadPAN = app.post('/upload', multipartMiddleware, function(req, res) {
 
  cloudinary.v2.uploader.upload(req.files.image.path,
    {
      ocr: "adv_ocr"
    }, function(error, result) {
        if( result.info.ocr.adv_ocr.status === "complete" ) {
          res.json(result); 
          var desp=(result.info.ocr.adv_ocr.data[0].textAnnotations[0].description);
}
   }
});

So currently this code uploads the image from local.

So my question is:

How to upload with an image url?

Suppose I have the url-> www.xyzasdfghjkl.png, then what would be the path and image in req.files.image.path

Community
  • 1
  • 1
Shitija
  • 5
  • 4

1 Answers1

-1

In order to upload an image from the web, you can just add the url as your image path.

For example: cloudinary.v2.uploader.upload("www.xyzasdfghjkl.png", function(error, result) { console.log(result); });

Shirly Manor
  • 271
  • 1
  • 3