title: cloudinary multiple .jpg uploads NODE.JS
body: <p>has any one of you tried to upload 50+ images to cloundinary? I been trying but the issue is that promise does not get resolved (even with .reflect() and fails to upload all images. Depending on the speed of uploads, it will fail 30% ~ 70%. </p>
  
  <p>Is there any ways to completely make it async and make sure all images are uploaded correctly? Only modules that I am using is bluebird and cloudinary module from their doc. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Promisebd = require('bluebird');
  
  function uploadimg(img, i, itemId) {
    var pubID = 'a2z/toys/' + itemId + '/' + i;
    // return new cloudImg.v2.uploader.upload(img, {
    return cloudinary.v2.uploader.upload(img, { // works
      public_id: pubID,
      quality: 90
      // use_filename: true,
    } , function(err, res){
      if(err) {
        console.log(err);
      }
      console.log(res);
    });
  }
  
  
  promiseArr.push(uploadimg(fullimg, i, d[0].details.detailsProductId)); // pushing the promises to Arr
  
    Promisebd.all(promiseArr.map(function(promise) {
              return promise.reflect();
            })).each(function(inspection) {
              if(inspection.isFulfilled()) {
                console.log('The promise is the arr was fulfilled with ', inspection.value());
              }else{
                console.log('The promise is NOT the arr was NOT fulfilled with ', inspection.reason());
              }
            })</code></pre>
  </div>
  </div>
  </p>