a-sabagh/simple-file-uploader

Simple and Secure PHP File Upload with great options and very light and easy to use.

1.0 2019-02-21 07:20 UTC

README

Latest Stable Version Total Downloads License composer.lock Say Thanks!

simple-file-uploader

🐘 Simple and Secure PHP File Uploader with greate options and very light and easy to use.

Requirement

  • php 5.6 >=

Install Package

to install simple-file-uploader in your php project you can using composer

composer require a-sabagh/simple-file-uploader

if you never willing to using composer you can download from Package and require src/Uploader.php and use namespace

Usage

first,use name space and create object from Uploader class

use SimpleUploader\Uploader;
$handle = new Uploader(__DIR__ . "/uploads");

Uploader class just accept one parameter as a destination of uploader files

Method Parameter Return Descriptions
$handle->setType() Array Void Set acceptable file type for Uploading
$handle->setMaxSize() Integer Void Set max size for file in Byte
$handle->getMessages() NULL Array Get result message of uploading proccess
$handle->upload() $_FILE['file_name'] Array Upload files and return uploading files info

License

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