PHP code example of juniwalk / image-storage
1. Go to this page and download the library: Download juniwalk/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/ */
juniwalk / image-storage example snippets
/** @var JuniWalk\ImageStorage\Media */
$media = Media::fromImage(string $name, Nette\Utils\Image $image)
$media = Media::fromUpload(Nette\Http\FileUpload $fileUpload, string $name = NULL);
$media = Media::fromFile(string $filename);
$media = Media::fromString(string $name, string $content);
/** @var \JuniWalk\ImageStorage\ImageStorage */
$imageStorage = $this->getImageStorage();
/** @var string Relative path to $wwwDir */
$path = $imageStorage->store(string $storage, Media $media);