Closed EdsenxX closed 1 year ago
Hi @EdsenxX ,
You can use:
import cloudinary from "cloudinary.v2"
Best regards, Mo
HI @momoip, that does not work for me, I have the next error
Hi @EdsenxX , could you please try to import it like so:
let cloudinary = require('cloudinary').v2;
Or, alternatively, you could replace cloudinary.uploader.upload
with cloudinary.v2.uploader.upload
Please let us know how it goes.
@aleksandar-cloudinary thank you, that worked for me, I replace cloudinary.uploader.upload
with cloudinary.v2.uploader.upload
Describe the bug in a sentence or two.
When uploading an image using the cloudinary SDK from nextjs and defining the folder where I want it to be stored, it simply ignores it and uploads it to the root.
Issue Type (Can be multiple)
[ ] Build - Can’t install or import the SDK [ ] Babel - Babel errors or cross browser issues [ ] Performance - Performance issues [x] Behaviour - Functions aren’t working as expected (Such as generate URL) [x] Documentation - Inconsistency between the docs and behaviour [ ] Incorrect Types - For typescript users who are having problems with our d.ts files [ ] Other (Specify)
Steps to reproduce
I tried using folder, public_id, and asset_folder and none of them worked for me.
Error screenshots
This is the response I have, the folder is simply ignored.
Versions and Libraries
Cloudinary_NPM SDK version Node - 18.4.0 NPM - 8.12.1
Config Files
Package.json