Download the PHP package reich/upload without Composer
On this page you can find all versions of the php package reich/upload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package upload
Short Description A great class to upload your file or files to the server
License MIT
Homepage https://github.com/edenreich
Informations about the package upload
Upload.php
PHP Class for uploading file or files to the server
Installing
with composer just run:
or
You can also download src/Upload.php and simply use it.
As a Package for Laravel
This class is fully integrated into laravel framework using Laravel Auto-Discovery. If you don't use v5.5+ you may import the necessary files path in your /config/app.php file manually:
Usage
1) Copy the class that located in the src directory into your project or install it via composer and use it.
2) Generate an encryption key contains 32 characters or use Reich\Upload::generateMeAKey(); helper.
3) Please open the example /demo/index.php file I created to follow and get a better understanding
Make sure the form is submitted:
Make an instance of the class
Set the directory where you want to upload the files, by default it will upload to your main directroy
You may also specify that you want to create this directory if it's not exists
You can set the rules you want for your upload using the following syntax:
or
Set this only if you want to have a encrypt file names(optional for security):
You may also specify that you want only certain file type to be encrypted like so:
Or also the following syntax:
After all is set just run the following command
Events
Whenever a file has been successfully uploaded.
If something went wrong listen to error.
Error Handling
Check wether there are errors and if there arent errors, proccess the upload: