Class 'Cloudinary\Error' not found

Comments

5 comments

  • Avatar
    Marissa Masangcay

    Hi,

    To answer your questions in order:

    1. PHP 7 is supported by our SDK.

    2. There is a chance there may be an error with your upload call so the 'error.php' file is being looked for and not found. This file should be located in the src folder so you can include it like so:

    require 'src/Error.php';

    Hope this helps!

    0
    Comment actions Permalink
  • Avatar
    Faulkner Temidayo Victor

    Good day, I trust you are doing great? Sorry, I am integrating cloudinary into a web application using PHP. I have been able to sucessfully upload files to the Cloudinary account via the website. But I cannot delete files via the website. 

    (new UploadApi())->upload('images/png3.png'): This is the code that works for uploading the file.
    $cloudinary = (new UploadApi())->uploadApi->destroy('fospit5jdyahwyuhz1ci'); I try using this to delete files, but I keep getting the error: Warning: Undefined property: Cloudinary\Api\Upload\UploadApi::$uploadApi in C:\xampp\htdocs\Branded\config-cloud.php on line 22

    Fatal error: Uncaught Error: Call to a member function destroy() on null in C:\xampp\htdocs\Branded\config-cloud.php:22 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Branded\config-cloud.php on line 22.
    Please, what is the way out
     
    0
    Comment actions Permalink
  • Avatar
    Wissam Khalili

    Hi Faulkner,

    You should simply do the following for the destroy action : 
    $cloudinary = (new UploadApi())->destroy('fospit5jdyahwyuhz1ci');
    without the added uploadApi()-> in the middle.
    Please give it a try and let me know how it goes.
    Thanks,
    Wissam

     

    0
    Comment actions Permalink
  • Avatar
    Faulkner Temidayo Victor

    Thanks you so much Wissam, the issue has been resolved. I ddnt reference the delete action properly. Cheers.

    0
    Comment actions Permalink
  • Avatar
    Wissam Khalili

    Thanks for the update, glad I could help.

    0
    Comment actions Permalink

Please sign in to leave a comment.