Download the PHP package hostkurd/flocms-uploader without Composer
On this page you can find all versions of the php package hostkurd/flocms-uploader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package flocms-uploader
FloCMS Uploader
hostkurd/flocms-uploader is a production-ready upload package for FloCMS. It supports:
- local public uploads
- local private uploads
- AWS S3 uploads
- secure MIME and extension validation
- random filenames by default
- optional original-name preservation
- date-based folders
- single and multi-file uploads
- image resizing, fitting, optimization, and version generation
- GD or Imagick image drivers
Installation
For AWS S3 support:
Recommended FloCMS structure
public/uploadsfor publicly accessible assets like avatars, post images, and product photos.storage/uploadsfor protected files like invoices, reports, and private user documents.
Configure the package
Create config/upload.php in your FloCMS app and copy the example from this package.
A good place to do that is inside your bootstrap sequence, right after your framework loads config.
Example config
Basic file upload
Directory selection
You can choose the target directory per upload:
Multiple uploads
Image uploads with versions
The original image is kept by default and stored under:
Generated versions are stored like:
AWS S3 example
Security notes
- The package validates upload errors before moving files.
- It uses
finfoto detect MIME type. - It validates file extension and MIME type independently.
- It uses random filenames by default.
- It validates real images with
getimagesize()before image processing. - It rejects traversal, absolute paths, unsafe path segments, and symlink escapes from local storage roots.
- It calculates upload size from the temporary file rather than trusting the browser-provided size.
- Common executable/script extensions are blocked by default. Configure
blocked_extensionsonly if a private-storage use case requires a different policy. - A fixed filename cannot replace the extension that was validated.
- It does not support SVG sanitization. Do not allow SVG uploads until you add a sanitizer.
Public API overview
FloCMS\Uploader\Uploader
configure(array $config): voiddisk(string $disk): Uploadermake(?array $config = null): UploaderonDisk(string $disk): selfdirectory(string $directory): selfto(string $directory): selfuseDatePath(bool $enabled = true): selfpreserveOriginalName(bool $enabled = true): selffilename(string $filename): selfvisibility(string $visibility): selfallowExtensions(array $extensions): selfallowMimeTypes(array $mimes): selfmaxBytes(int $bytes): selfimageDimensions(array $dimensions): selfupload(array $file, ?string $directory = null): UploadResultuploadMany(array $files, ?string $directory = null): array
FloCMS\Uploader\Image\ImageUploader
versions(array $versions): selfkeepOriginal(bool $enabled = true): selfoptimize(bool $enabled = true): selfquality(int $quality): selfdriver(string $driver): self
FloCMS integration suggestion
Inside your bootstrap after config is loaded:
Then your controllers can use the package directly.
Notes
Uploader::disk('public')is the clean entry point for regular files.Uploader::image()->onDisk('public')is the clean entry point for image processing.- If you want a framework-level helper later, you can wrap this package with your own
upload()oruploader()helper in FloCMS core.
All versions of flocms-uploader with dependencies
ext-fileinfo Version *