2017 © Pedro Peláez
 

library simple-upload

Simple upload system

image

wsw/simple-upload

Simple upload system

  • Monday, December 11, 2017
  • by whera
  • Repository
  • 6 Watchers
  • 87 Stars
  • 869 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 5 Versions
  • 25 % Grown

The README.md

SimpleUpload

Simple upload system in PHP, compatible with AWS S3, Dropbox, Azure and others., (*1)

Travis Code Coverage Scrutinizer Code Quality Github All Releases Packagist license, (*2)

Component responsible for simplifying file upload. With it it is possible to perform local uploads and services such as: Dropbox, AWS S3, Azure, SFTP among others. Check out the full list here., (*3)

Installation

Via Composer:, (*4)

composer require wsw/simple-upload

Usage

Basic use:, (*5)

``` php <?php, (*6)

use League\Flysystem\Adapter\Local; use WSW\SimpleUpload\Services\SimpleUpload;, (*7)

try { $adapter = new Local('/home/files'); $file = SimpleUpload::create($_FILES['file'], $adapter)->send();, (*8)

} catch (\Exception $e) { echo $e->getMessage(); }, (*9)


Advanced use: ``` php <?php use League\Flysystem\Adapter\Local; use WSW\SimpleUpload\Services\SimpleUpload; try { $adapter = new Local('/home/files'); $upload = SimpleUpload::create($_FILES['file'], $adapter); // Optional Methods //Create a new directory from the root directory defined on the adapter. $upload->setPath('newDir'); // Ex:/home/files/newDir/ // Define a new file name $upload->setName('newName'); // Ex: newName.csv // Defines which file extensions the upload will allow $upload->setAllowedExtensions(['csv', 'txt']); $file = $upload->send(); } catch (\Exception $e) { echo $e->getMessage(); }

Result

``` php <?php // Returns the size of the file in KB echo $file->getSize(); // 94762, (*10)

// Returns the file type echo $file->getMimetype(); // text/plain, (*11)

// Returns instance of DateTime for date and time of creation echo $file->getTimestamp(); // \DateTime, (*12)

// Absolute file path echo $file->getPath(); // /home/files/file.txt, (*13)

// Directory where the file is located echo $file->getFilePath(); // /home/files/, (*14)

// Filename with extension echo $file->getFileName(); // file.txt, (*15)

// Filename without extension echo $file->getName(); // file, (*16)

// File extension echo $file->getExtension(); // txt, (*17)


## Testing ``` bash $ composer test

Security

If you discover any security related issues, please email ronaldo@whera.com.br instead of using the issue tracker., (*18)

Credits

License

The MIT License (MIT). Please see License File for more information., (*19)

The Versions

11/12 2017

dev-master

9999999-dev

Simple upload system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronaldo M. Rodrigues

filesystem update aws simple azure ftp integration dropbox aws-s3 wsw whera

11/12 2017

1.0.3

1.0.3.0

Simple upload system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronaldo M. Rodrigues

filesystem update aws simple azure ftp integration dropbox aws-s3 wsw whera

11/04 2017

1.0.2

1.0.2.0

Simple upload system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronaldo M. Rodrigues

filesystem update aws simple azure ftp integration dropbox aws-s3 wsw whera

04/04 2017

1.0.1

1.0.1.0

Simple upload system

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronaldo M. Rodrigues

filesystem update aws simple azure ftp integration dropbox aws-s3 wsw whera