Skip to main content

Upload image to specified folder node js with cloudinary.v2



  • Stephen Doyle

    Hi Rizky,

    The first parameter of the `upload()` method in the SDK is the file to upload (the 'file' parameter sent to the API endpoint) and any other options specified should be set in an options array, passed as the second parameter to the API call

    To set the folder path, you can do this by specifying the public_id value directly and including the folder path there, or by passing the 'folder' parameter, which will set a folder path (and then use whichever method of naming the file was specified or implied by the other upload options)

    There's more information here in the Upload documentation, and as with many of the cod examples you can click a tab to see a specific Node example:

    For your example code, a minimally-changed example would be:

    .upload(data.pict, {folder: 'myfolder'})

    May I ask you to please try that and let me know if it works?


  • Amplify

    Thanks, Stephen it works for me.

  • suvrow

    thanks, Stephen it also work for me


Post is closed for comments.