connect232/cakephp-upload

Upload plugin for CakePHP

Installs: 18

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:cakephp-plugin

v2.4 2021-04-15 09:44 UTC

This package is auto-updated.

Last update: 2024-09-07 18:44:29 UTC


README

Installation

Run:

composer require connect232/cakephp-upload

Usage

Run : bin/cake plugin load Upload Or in your src/Application.php add:

$this->addPlugin('Upload');

In your model initialize():

$this->addBehavior('Upload.Upload', [
	'your_field_name' => [
			'path' => 'directory/to/save/file/to'
		]
	]
);

If you have baked your model remove the scalar validation:

$validator->scalar('foo');

Modify your form to accept files

$this->Form->create($foo, ['type' => 'file']);

Modify your field's type to file

$this->Form->control($foo, ['type' => 'file']);