bera / upload
a package for upload files
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/bera/upload
This package is auto-updated.
Last update: 2025-09-20 22:36:51 UTC
README
easy file upload for php
Installation
Use composer to install Bera Upload.
composer require bera/upload
Usage
require 'vendor/autoload.php'; $new_upload = new \Bera\Upload\Upload($_FILES['data']); $new_upload->setUploadConditon( [ 'file_size' => '20M', 'allowed_extension' => ['dll','png','jpeg','jpg','pdf'] ]); $new_upload->setUploadDir(__DIR__ . '/upload'); try { if($new_upload->upload()) { echo 'upload done!'; } else { echo 'upload failed'; } }catch ( \Bera\Upload\Exception\FileTypeNotSupprotExectpion $e) { echo $e->getMessage(); }catch ( \Bera\Upload\Exception\UplodMaxSizeException $e) { echo $e->getMessage(); }
License
MIT Licence