PHP code example of basic / upload
1. Go to this page and download the library: Download basic/upload 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/ */
basic / upload example snippets
asic\Upload;
$Upload=new Upload();
$exts=[
'jpg',
'png',
'gif'
];
$file=$Upload->upload('file',$exts);
if(isset($file['errors'])){
print '<pre>';
print_r($file['errors']);
}else{
print 'arquivo enviado com sucesso';
}