Skip to content

jdmaymeow/cake-file

Repository files navigation

CakeFile plugin for CakePHP

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require jdmaymeow/cake-file

File uploading

This package contain UploaderCompoent to use it, add to your controller

$this->loadComponent('CakeFile.Uploader', [
    'upload_domain' => 'nodes',
    'upload_dir' => 'images'
]);

And call upload in your function for example

$node->attribute_image = $this->Uploader->upload($node->image);