t-kanstantsin / fileupload
File upload and store utilities
Installs: 1 146
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 7
Requires
- php: >=7.1
- guzzlehttp/guzzle: ^6.3.0
- imagine/imagine: ^0.7.1
- league/flysystem: ~1.0
- ralouphie/mimey: ^1.0
Requires (Dev)
- codeception/codeception: ^2.3
- codeception/verify: ~0.3.1
- fzaninotto/faker: 1.5.*
- ps/image-optimizer: ^1.1.2
Suggests
- fortawesome/font-awesome: For file types without preview generator
- ps/image-optimizer: Image optimization toolkit
README
Widget for easily control for file upload, store and format.
Configuration
Full-featured configuration example:
<?php use \tkanstantsin\fileupload\FileManager; use \tkanstantsin\fileupload\formatter\Image; use \League\Flysystem\Adapter\Local as LocalFSAdapter; use \League\Flysystem\Filesystem; new FileManager([ 'uploadFS' => new Filesystem(new LocalFSAdapter(__DIR__ . '/tmp/upload', LOCK_EX, LocalFSAdapter::DISALLOW_LINKS)), 'cacheFS' => new Filesystem(new LocalFSAdapter(__DIR__ . '/tmp/web', LOCK_EX, LocalFSAdapter::DISALLOW_LINKS)), 'aliasArray' => [ 'attachment' => [ 'maxCount' => 1, ], ], 'formatterConfigArray' => [ 'attachment-gallery' => [ 'class' => Image::class, 'width' => 1920, 'height' => 1080, 'mode' => Image::RESIZE_INSET, ], 'attachment-preview' => [ 'class' => Image::class, 'width' => 300, 'height' => 150, 'mode' => Image::RESIZE_OUTBOUND, ], ], ]);
Alias
name - Alias name must contain only latin letters, digits, hyphen (-) and underscore
class
directory
maxSize
maxCount
multiple
hashMethod
cacheHashLength
filePathClosure
assetNameClosure