0

How can I resize multiple images and send stream to Cloudinary directly by using mutiparty:

router.post('/', function(req, res){
    var form = new multiparty.Form();

    form.on('part', function(part) {
       // Stream it to Cloudinary without saving it to disk
    }
}

I do this because I am hosting in the Azure website, there is no way to save the image in the temp folder.

Alvin
  • 8,219
  • 25
  • 96
  • 177

1 Answers1

0

Im not sure about that bu you can try:

var cloudinary = require('cloudinary'); //npm install cloudinary
cloudinary.config({/*your config object*/});
var request = require('request'); //npm install request

router.post('/', function(req, res){
    var form = new multiparty.Form();

    form.on('part', function(part) {
        if (part.filename) {
            var url = cloudinary.url(part.filename, {type: 'fetch'/*, width: 256*/});
            request.head(url, function (err, res, body) {
                //...
            });
        }
    }
}