How can i specify folder location with upload_stream method

Comments

1 comment

  • Avatar
    Eric Pasos

    Hi Jerry,

    The parameters to the upload_stream method can be added in addition to the callback, which can be done as:

    ...
    constcloudStream = cloudinary.v2.uploader.upload_stream(
    {
       folder:"yourtargetfolder"
    },
    function (err, fileUploaded) {
      // In case something hit the fan
      if (err) {
           reject(err);
        }

       // All good :smile:
       resolve(fileUploaded);
    });
    ...

    The "yourtargetfolder" will be automatically created in your Media Library, in case it does not exist.

    Hope this helps.

    0
    Comment actions Permalink

Please sign in to leave a comment.