1. Go to this page and download the library: Download nattreid/image-storage 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/ */
nattreid / image-storage example snippets
class BasePresenter {
use \NAttreid\ImageStorage\TraitImagePresenter;
}
/* @var $fileUpload \Nette\Http\FileUpload */
$resource = $storage->createUploadedResource($fileUpload);
// nebo z cesty
/* @var $location string */
$resource = $storage->createResource($location);
// pridame namespace
$resource->setNamespace('namespace');
// ulozime
$storage->save($resource);
// zobrazime url adresu
echo $storage->link($result);
// $id pro ulozeni
$id = $resource->getIdentifier();