Skip to content

Deprecated since 7.2

This page documents the classic module layer (CBController and cbInit()). It still works in every 7.x release, but new code should use resources and pages.

Use instead: FileUpload::make('photo')->image().

Upload Form Input Type ​

Showing an upload input type

Code Sample ​

php
$this->form[] = ['label'=>'Document','name'=>'document','type'=>'upload','upload_encrypt'=>false];

Upload With Image Validation ​

php
$this->form[] = ['label'=>'Document','name'=>'document','type'=>'upload','validation'=>'image'];

Upload With Image Validation and Size Validation ​

php
//Validate the image and limit the size to 1000 KB
$this->form[] = ['label'=>'Document','name'=>'document','type'=>'upload','validation'=>'image|max:1000'];

What's Next ​

Table Of Contents ​

Released under the MIT License.