PHP code example of alaxos / cakephp3-blueimp-upload
1. Go to this page and download the library: Download alaxos/cakephp3-blueimp-upload 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/ */
public $components = ['CakephpBlueimpUpload.Uploader'];
public $helpers = ['CakephpBlueimpUpload.BlueimpUpload'];
public function upload_picture($id = null)
{
...
$upload = $this->Uploader->upload($upload_folder, ['accepted_mimetypes' => ['image/jpeg', 'image/tiff', 'image/png']]);
if($upload !== false)
{
if($upload->complete)
{
/*
* The upload is over.
* Do what you want with the $upload entity
*/
}
}
...
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.