PHP code example of brenno-duarte / uplayer
1. Go to this page and download the library: Download brenno-duarte/uplayer 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/ */
brenno-duarte / uplayer example snippets
use Uplayer\Uplayer;
$up = new Uplayer('DIRETORIO_DOS_ARQUIVOS');
$res = $up->uploadFile('arquivo');
var_dump($res); //return `true`
$res = $up->uploadMultipleFiles('arquivos');
var_dump($res);
$allowed_extensions = ['png', 'jpg'];
$up->uploadFile('arquivo', $allowed_extensions);
$up->uploadMultipleFiles('arquivos', $allowed_extensions);