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

584
Views
How to fetch all images from cloudinary folder

I want to fetch all the images from a folder in cloudinary. as per the below code i want to return all the data fetched as a response to get post controller but when i make request from my react app it says result is not defined. Please share some logic on how to return all the fetched images

Also need help on how to fetch a single image inside a folder in cloudinary using {id} as param

`    




     import { catchAsyncErr } from "../middleware/catchAsyncErrors.js";
     export const getPosts = catchAsyncErr(async (req, res) => {
     cloudinary.v2.api.resources({
     type: 'upload',
     prefix: '{my_folder_name}' // add your folder
   },
    function(error, result) { console.log(result, error) });
    res.status(200).json({
    success: true,
    result,
   });
  });
   //
   router.route("/posts").get(getPosts)

`

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

try to put

res.status(200).json({
    success: true,
    result,
      });

inside

function(error, result) { console.log(result, error);
res.status(200).json({
        success: true,
        result,
       });
 })
about 4 years ago · Juan Pablo Isaza Report
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!