Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

586
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda