alexkratky / fileupload
Class to process file upload.
v1.0.0
2020-05-14 08:40 UTC
Requires
- php: >=7.0
- alexkratky/db: ^1.0.0
This package is auto-updated.
Last update: 2024-12-14 18:58:34 UTC
README
Class to process file upload
Installation
composer require alexkratky/fileupload
Usage
require 'vendor/autoload.php'; use AlexKratky\FileUpload; use AlexKratky\db; db::connect('localhost', 'root', '', 'db'); FileUpload::_setUploadDirectory($_SERVER['DOCUMENT_ROOT'] . '/random/'); // You can set static upload directory, so every instance will have this directory $fu = new FileUpload(); $fu->setUploadDirectory($_SERVER['DOCUMENT_ROOT'] . '/uploads/'); // But you can override every settings for each instance var_dump($fu->process('files'));
<form method="POST" enctype="multipart/form-data"> <input name="files[]" type="file" multiple="multiple" /><br /> <input type="submit" value="Send files" /> </form>