PHP code example of alexkratky / fileupload

1. Go to this page and download the library: Download alexkratky/fileupload library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alexkratky / fileupload example snippets



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'));