PHP code example of falcon758 / phlexus-library-media

1. Go to this page and download the library: Download falcon758/phlexus-library-media 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/ */

    

falcon758 / phlexus-library-media example snippets


use Phlexus\Libraries\Media\Files\Upload;
use Exception;

$files = $this->request->getUploadedFiles(true, true);

try {
    $uploader = new Upload();
    $status = $uploader->setFile($files['image'])
                        ->upload();
} catch (Exception $e) {
    exit($e->getMessage());
}