Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simon28082/file-upload
Large file upload under HTTP protocol
https://github.com/simon28082/file-upload
file-upload laravel-upload php upload upload-file
Last synced: 16 days ago
JSON representation
Large file upload under HTTP protocol
- Host: GitHub
- URL: https://github.com/simon28082/file-upload
- Owner: simon28082
- License: mit
- Created: 2017-08-30T07:28:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-24T23:38:21.000Z (over 6 years ago)
- Last Synced: 2024-09-14T12:23:08.911Z (2 months ago)
- Topics: file-upload, laravel-upload, php, upload, upload-file
- Language: PHP
- Homepage:
- Size: 441 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# File Upload
## Config
```
['default' => 'default',
'uploads' => [
'default' => [
'driver' => \CrCms\Upload\Drives\DefaultUpload::class,//
'options' => [
'setFileSize' => 1024 * 1024 * 2,
'setRename' => true,
'setCheckMime' => true,
'setCheckExtension' => true,
'setExtensions' => ['jpg', 'jpeg', 'gif', 'png'],
'setHashDirLayer' => 2,
'setPath' => './uploads',
]
],
'test' => [
'driver' => \CrCms\Upload\Drives\WebUpload::class,//
'options' => [
'setFileSize' => 1024 * 1024 * 2,
'setRename' => true,
'setCheckMime' => true,
'setCheckExtension' => true,
'setExtensions' => ['jpg', 'jpeg', 'gif', 'png'],
'setHashDirLayer' => 2,
'setPath' => './uploads',
]
],
],'drives' => [
'webupload' => [
'chunk_name' => 'chunk',
'chunks_name' => 'chunks',
'size_name' => 'orig_size',
'new_name' => 'new_name',
],
],]
```
## Example
### DefaultUpload
```
require '../vendor/autoload.php';$config = require '../config/upload.php';
$config = new \Illuminate\Config\Repository(['upload'=>$config]);$upload = new \CrCms\Upload\FileUpload($config);
$file = $upload->config('test')->upload();
//default
$upload->upload();print_r($file);
```## Install
You can install the package via composer:
```
composer require crcms/file-upload
```## Laravel
Modify ``config / app.php``
```
'providers' => [
CrCms\Upload\LaravelServiceProvider::class,
]```
If you'd like to make configuration changes in the configuration file you can pubish it with the following Aritsan command:
```
php artisan vendor:publish --provider="CrCms\Upload\LaravelServiceProvider"
```## Laravel Testing
View ``test/upload.php``
## License
MIT