1. Go to this page and download the library: Download iscosta77/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/ */
iscosta77 / upload example snippets
use Hermes\Upload\Upload;
use Iscos\Voodoo\Voodoo;
$db = Voodoo::fromEnv(); // .env formato Laravel
$upload = new Upload($db, [
'pasta' => 'uploads',
'max_tamanho' => 2 * 1024 * 1024, // 2 MB
'permitidos' => ['jpg', 'png', 'webp'], // [] = qualquer extensão
'regras' => ['titulo' => ' // id na hermes_uploads
echo $registro['caminho']; // uploads/20260825-...-a1b2.jpg
echo $registro['imagem_id']; // id na hermes_images (null se nao for imagem)
use Hermes\Upload\UploadRepository;
$repo = new UploadRepository($db);
$repo->criaTabela(); // idempotente
$repo->buscar(3); // Row da hermes_uploads
$repo->listar('galeria', 20); // últimas 20 do tipo
$repo->contar('documento');
$repo->apagar(3); // remove arquivo + registro + hermes_images
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.