1. Go to this page and download the library: Download jovialcore/cake-cloudinary library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// src/Controller/YourController.php
namespace App\Controller;
use Cake\Controller\Controller;
use Cake\Event\EventInterface;
class YourController extends Controller
{
public function initialize(): void
{
parent::initialize();
$this->loadComponent('CakeCloudinary.Cloudinary');
}
// ...
}
$url = $this->Cloudinary->getUrl(); // get url of uploaded file (http)
$secureUrl = $this->Cloudinary->getSecureUrl(); // get secureUrl of the uploaded asst
$publicId = $this->Cloudinary->getPublicId(); // get public Id of the uploaded asset
$originalFIleName = $this->Cloudinary->getOriginalFileName(); // get the asset name before it was uploaded to cloudinary
$resourceType = $this->Cloudinary->getUploadedAt(); // get the time the asset as uploaded
$extension = $this->Cloudinary->getExtension(); // get file extension of the uploaded asset e.g jpg, .pdf, .png, etc
$fileType = $this->Cloudinary->getFileType(); // get asset type. E.g, image, video, etc.
$fileSize = $this->Cloudinary->getFileSize(); //get uploaded asset file's size by defaults, it returns a human readable file size like 20MB, 20kb, etc
// If you prefer to get just the raw bytes,
$fileizeInBytes = this->Cloudinary->getFileSize(['human_readable' => false]);
$height = $this->Cloudinary->getHeight(); // get asset height
$width = $this->Cloudinary->getWidth(); // get asset width
$res = $this->Cloudinary->delete($publidId);
// get url from an asset
$url = $this->Cloudinary->fetchUrl($publicId);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.