2017 © Pedro Peláez
 

library file-upload

php file upload

image

crcms/file-upload

php file upload

  • Tuesday, January 9, 2018
  • by hiword
  • Repository
  • 0 Watchers
  • 1 Stars
  • 364 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

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:, (*1)

composer require crcms/file-upload

Laravel

Modify config / app.php, (*2)

'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:, (*3)

php artisan vendor:publish --provider="CrCms\Upload\LaravelServiceProvider"

Laravel Testing

View test/upload.php, (*4)

License

MIT, (*5)

The Versions

09/01 2018

dev-master

9999999-dev

php file upload

  Sources   Download

MIT

The Requires

 

php upload plupload laravel upload