How to list all images within a folder?

Follow

Comments

15 comments

  • Avatar
    cuma elp

    is there any php sample for this?

  • Avatar
    Nadav Ofir

    The following is the equivalent in PHP:

    $api->resources(array("type" => "upload", "prefix" => "my_folder/"));

  • Avatar
    cuma elp

    i wish there's a thank u or vote button.
    anyway, thank u for your help. i'll try this later

  • Avatar
    Chester Copperpot

    is there a way to get the transformed image urls for the photos in that folder?

  • Avatar
    Nadav Ofir

    Chester, This will require writing a short script:
    First you will have to list all resources within the folder.
    Then, for every public ID, you will be able to list all of its transformed versions using the resource() method

    If you need any additional assistance, feel free to open a support ticket.

  • Avatar
    Robin

    Hello can someone help me out.

    I'm new to Cloudinary and using the service for delivering image http url's for delivering to a webshop service. The will read them one time only to fill their databas.

    Can i make a list with all my uploaded pictures in Cloudinary and export or see the image url all together.

    I can now only get the links when i click them one by one.

  • Avatar
    Nadav Ofir

    Exporting such a list requires using the Admin-API. It's on our roadmap to add UI support for this task as well.
    If you're having difficulties getting this done, feel free to open a support ticket and we'll be happy to assist.

  • Avatar
    Mark Gavagan

    SIMPLE: While in your media library, once you're in the right folder or have the right images displayed, select the one on the top-right, scroll down and (Mac) hold shift while selecting the last image in the group, and all in between are selected automatically.

  • Avatar
    swapcase

    Sir , I can neither code in PHP nor in Node.js, is there any other way of achieving this? ANy ETA on the UI feature implementation?
    Its stopping my business deliverable and I would urgently need the list of image URLs in csv/text format.
    Is there any work around for this issue?

  • Avatar
    swapcase

    Or leave it, I dont have time and didnt get support from cloudinary so Ive found a workaround with zero coding efforts.
    Thanks :)

  • Avatar
    Nadav Ofir

    Hi dear users,

    While we don't yet have an ETA for this functionality, you can rest assure that we will update here as soon as this becomes available.

  • Avatar
    Gex Tecnologia

    Can I list every file of a folder? I tried that way and returns only images:

    (In PHP)
    $api->resources(array("type" => "upload", "prefix" => "folder1/folder2/"));

    But i want that bring me images, videos and raw files at same time. It can be done?

  • Avatar
    Nadav Ofir

    Hi, currently this kind of task requires making 3 separate API calls and then merging the results.

  • Avatar
    Amol Bapat

    Thanks for this, for others, this response that api returns, is enough to get the list of URLs into any type of file by some coding. You just need to pick up the URLs from the response and insert into your DB and then do some coding to achieve what you need.

  • Avatar
    Jake

    Here is how you use PHP to show all images in a folder....

    $api = new \Cloudinary\Api();
    $resources = ((array) $api->resources(["type" => "upload", "prefix" => "projects/test"])['resources']);
    foreach ($resources as $resource) {
    echo cl_image_tag($resource['public_id']);
    }

Please sign in to leave a comment.