Fork me on GitHub

Library - Uploader

#Uploader

#OverView

This component simplifies file validation and uploading. as well as it helps you to upload your file quickly. To use the class is very easy and simple.

#Option Info

The uploading library helps you to upload your file quickly. To use the class is very esay and simple so you can customize the code if you want. Thank you for using the library..

#How To Use

POST Request Info(HTML Code)


<form action="http://youtdomain.com/" method='post' enctype="multipart/form-data">
    <input type="file" name="test01"  value=''>
    <input type="submit" name="submit">
</form>

PHP code


<?php

use CafeLatte\Libraries\FileUploader;

try {
        $firstFileName = FileUploader::create("/",$this->request->file('test01'))->upload()->getResult();

    print_r($firstFileName01);

} catch (Exception $ex) {
    echo $ex->getMessage();
}

Response Data


Array
(
    [name] => 20171013_163612.jpg
    [type] => image/jpg
    [tmp_name] => /tmp/phpQp9ByF
    [error] => 0
    [size] => 1610
)