Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
I am not able to upload image on the cloudinary using mern stack

Here is the source code github of my current project which i am working i belive i might doing something very stupid i cant figure whats that The main issue in my life is i am getting the image in my backend but while uploading my server just crash Here is my function registerUser Whose Purpose to life is get data and put it in database and upload image on the cloudinary as you can see i am consoling log name and avatar which proves i am getting data in my function perfectly the line const myCloud = await cloudinary.v2.uploader.upload(req.body.avatar, { folder: "avatars", width: 150, crop: "scale", }); is crashing server

exports.registerUser = catchAsyncErrors( async(req,res,next)=>{
  console.log("The file is ",req.body.name);
  console.log("The cloudinary function is ",req.body.avatar);
  const myCloud = await cloudinary.v2.uploader.upload(req.body.avatar, {
    folder: "avatars",
    width: 150,
    crop: "scale",
  });
    console.log("The value of my cloud is",myCloud)
    const {name,email,password} = req.body;
    
    const user = await User.create({
        name,email,password,
        avatar:{
            public_id:myCloud.public_id,
            url:myCloud.secure_url,
            // public_id:"This is the public id",
            // url:"THis is url",
        }
    });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!