<?php 
    require_once '../vendor/autoload.php';
    function do_upload($file_tmp, $file_name){
        \Cloudinary::config(array(
            'cloud_name' => 'dvtoppzy5',
            'api_key' => '321188798561537',
            'api_secret' => 'Nl9xyqe3T-jGqSeHNV9_n0yeWKI'
        ));
         $upload = \Cloudinary\Uploader::upload(
            $file_tmp,
            array_merge(
               array('tags' => 'basic_sample'),
               array('public_id' => $file_name)
            )
      );
      return $upload;
    }

    function delete($chave){
       \Cloudinary::config(array(
            'cloud_name' => 'dvtoppzy5',
            'api_key' => '321188798561537',
            'api_secret' => 'Nl9xyqe3T-jGqSeHNV9_n0yeWKI'
        ));
        $api = new \Cloudinary\Api;
        $api->delete_resources($chave);
    }
?>