Skip to main content

Class 'Cloudinary\Uploader' not found

Comments

3 comments

  • Roee Ben Ari

    Hi Nicolas,

    When uploading non-image files (video/audio or raw files) the resource_type parameter needs to be explicitly set. In your case that would be:

    'resource_type' => 'video'

    Please try running:

    \Cloudinary\Uploader::destroy(<public_id>, 'resource_type' => 'video');

     

    0
  • Nicolas Stencel

    Now when I do

    \Cloudinary\Uploader::destroy($story->audio_url, 'resource_type' => 'audio');

    I'm getting the error:

    syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'

    Do I have to include something? Like require/use Cloudinary at the beginning of my file? I already did

    composer require 'cloudinary/cloudinary_php:^1.20.0'

    I'm using Laravel and not pure PHP, if that helps diagnose the issue.

    0
  • Loic Verger Del Bove

    Hi Nicolas,

    Could you please try the following syntax and let me know if that works?

    \Cloudinary\Uploader::destroy($story->audio_url, ['resource_type' => 'video']);

    Thanks,

    Loic

    0

Post is closed for comments.