Uploader is a set of small classes for sending images, files, and media received by a form of your application

Overview

Uploader @KitsuneCode

Uploader is a set of small classes for sending images, files, and media received by a form of your application. The Uploader handles, validates and sends the files to your server. Image class can still handle sizes with the gd library.

Uploader é um conjunto de pequenas classes para envio de imagens, arquivos e midias recebidos por um formulário de sua aplicação. O Uploader trata, valida e envia os arquivos a seu servidor. A classe de imagem ainda consegue tratar tamanhos com a biblioteca gd.

About KitsuneCode

KitsuneCode is a set of small and optimized PHP components for common tasks. Held by Enos S. S. Silva and the Kitsune team. With them you perform routine tasks with fewer lines, writing less and doing much more.

KitsuneCode é um conjunto de pequenos e otimizados componentes PHP para tarefas comuns. Mantido por Enos S. S. Silva e a equipe Kitsune. Com eles você executa tarefas rotineiras com poucas linhas, escrevendo menos e fazendo muito mais.

Highlights

  • Image simple upload (Simples envio de imagems)
  • File simple upload (Simples envio de arquivos)
  • Media simple upload (Simples envio de midias)
  • Managing directories with date schemas (Gestão de diretórios com esquema de datas)
  • Validation of images, files and media by mime-types (Valida de imagens, arquivos e mídias por mime-types)
  • Composer ready and PSR-2 compliant (Pronto para o composer e compatível com PSR-2)

Installation

Uploader is available via Composer:

"kitsunecode/uploader": "2.0.*"

or run

composer require kitsunecode/uploader

Documentation

For details on how to use the upload, see a sample folder in the component directory. In it you will have an example of use for each class. KitsuneCode Uploader works like this:

Para mais detalhes sobre como usar o upload, veja uma pasta de exemplo no diretório do componente. Nela terá um exemplo de uso para cada classe. KitsuneCode Uploader funciona assim:

Upload an Image

upload($_FILES['image'], $_POST['name']); echo ""; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"; } }">

require __DIR__ . "/../vendor/autoload.php";

//$image = new KitsuneCode\Uploader\Image("uploads", "images", false); //WITHOUT YEAR AND MONTH FOLDERS //SEM PASTAS DE ANO E MÊS
$image = new KitsuneCode\Uploader\Image("uploads", "images");

if ($_FILES) {
    try {
        $upload = $image->upload($_FILES['image'], $_POST['name']);
        echo "";
    } catch (Exception $e) {
        echo "

(!) {$e->getMessage()}

"
; } }

Upload an Image Webp

uploadWebp($_FILES['image'], $_POST['name']); echo ""; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"; } }">

require __DIR__ . "/../vendor/autoload.php";

$image = new KitsuneCode\Uploader\Image("uploads", "images");

if ($_FILES) {
    try {
        $upload = $image->uploadWebp($_FILES['image'], $_POST['name']);
        echo "";
    } catch (Exception $e) {
        echo "

(!) {$e->getMessage()}

"
; } }

Upload an File

upload($_FILES['file'], $_POST['name']); echo "

@KitsuneCode

"; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"; } }">

require __DIR__ . "/../vendor/autoload.php";

$file = new KitsuneCode\Uploader\File("uploads", "files");

if ($_FILES) {
    try {
        $upload = $file->upload($_FILES['file'], $_POST['name']);
        echo "

@KitsuneCode

"
; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"
; } }

Upload an Media

upload($_FILES['file'], $_POST['name']); echo "

@KitsuneCode

"; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"; } }">

require __DIR__ . "/../vendor/autoload.php";

$media = new KitsuneCode\Uploader\Media("uploads", "medias");

if ($_FILES) {
    try {
        $upload = $media->upload($_FILES['file'], $_POST['name']);
        echo "

@KitsuneCode

"
; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"
; } }

Upload by Filetype (Send)

upload($_FILES['file'], $_POST['name']); echo "

@KitsuneCode

"; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"; } }">

require __DIR__ . "/../vendor/autoload.php";

$postscript = new KitsuneCode\Uploader\Send("uploads", "postscript", ["application/postscript"]);

if ($_FILES) {
    try {
        $upload = $postscript->upload($_FILES['file'], $_POST['name']);
        echo "

@KitsuneCode

"
; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"
; } }

Upload Multiple

multiple("file", $_FILES) as $file) { $image->upload($file, "image-" . $file["name"], 1200); } echo "Success!"; } catch (Exception $e) { echo "

(!) {$e->getMessage()}

"; }">
require __DIR__ . "/../vendor/autoload.php";

$image = new KitsuneCode\Uploader\Image("uploads", "images");

try {
    foreach ($image->multiple("file", $_FILES) as $file) {
        $image->upload($file, "image-" . $file["name"], 1200);
    }
    echo "Success!";
} catch (Exception $e) {
    echo "

(!) {$e->getMessage()}

"
; }

Support

Security: If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Se você descobrir algum problema relacionado à segurança, envie um e-mail para [email protected] em vez de usar o rastreador de problemas.

Thank you

Credits

License

The MIT License (MIT). Please see License File for more information.

You might also like...
Akaunting is a free, open source and online accounting software designed for small businesses and freelancers

Akaunting is a free, open source and online accounting software designed for small businesses and freelancers

A simple wrapper for PHP Intervention Library to provide a more simple interface and convenient way to convert images to webp

This package is a simple wrapper for PHP Intervention Library to provide a more simple interface and convenient way to convert images to webp - next generation format - extension, and resize them to render only needed sizes.

Provides access to Cloudflare Images API for Laravel projects

Cloudflare Images Provides access to Cloudflare Images API for Laravel projects Table of contents Installation Configuration Using Installation To get

LiveZilla - a help desk software that offers a help desk solution for small companies to large businesses
LiveZilla - a help desk software that offers a help desk solution for small companies to large businesses

LiveZilla includes a live chat software with multi-website support, visitor monitoring and a help desk system that allows you to not only integrate emails that you receive from customers but also messages from Twitter and Facebook in your ticket system.

YouTubeClone - Web Projects Build By Laravel Framework v8 & LiveWire it's Small project to upload video Like Youtube
YouTubeClone - Web Projects Build By Laravel Framework v8 & LiveWire it's Small project to upload video Like Youtube

YouTubeClone YouTubeClone - Web Projects Build By Laravel Framework & LiveWire it's Small project to upload video Like Youtube Use Laravel v8.80.0 Ima

This mini project aims to design a set of APIs that manage transactions of a company

Introduction. This mini project aims to design a set of APIs that manage transactions of a company.Managing transactions include: creating transaction

CodeIgniter4 Attribute Routes. You can set Routes in Controllers as PHP8 Attributes.

CodeIgniter4 Attribute Routes This package generates a Routes File from the Attribute Routes in your Controllers. You can set routes in your Controlle

Simple-podcast-generator - 👉 A very simple way to host your podcast files and generate the RSS Podcast feed 🎙

Podcast RSS Feed Generator A very simple way to host your podcast files and generate the RSS Podcast feed 🎙 📖 Contents Summary Requirements Installa

A little PHP script created for uploading custom sharex files to your own webserver
A little PHP script created for uploading custom sharex files to your own webserver

ShareX-Custom-Upload A little PHP script created for uploading text, files, and images to your own webserver. It supports uploading via ShareX, but al

Owner
null
Interface Network is an application about social media

Interface Network is an application about social media

Noval 3 Apr 20, 2022
Linkfyle is a system that allows you to collect your social media accounts in one place and be reachable.

Linkfyle About Linkfyle is a system that allows you to collect your social media accounts in one place and be reachable. Features Login and Registrati

null 6 Dec 15, 2022
TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.

Prasath Mani 3.5k Jan 7, 2023
Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses related to services

Kyle Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses relat

Laravelista 36 Jul 15, 2022
Mini is a small Laravel application with 2 modules to go with the book Laravel: The Modular Way

Mini Mini is a small Laravel application with 2 modules to go with the book Laravel: The Modular Way Install Clone this repo git clone [email protected]:

David Carr 5 Dec 4, 2022
The classic email sending library for PHP - this is my personal fork, please post issues on the upstream project

PHPMailer - A full-featured email creation and transfer class for PHP Build status: Class Features Probably the world's most popular code for sending

Marcus Bointon 1.5k Dec 5, 2022
A mini social media like web app built using Laravel 8 & Vue JS 3

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Davidson Ramos 2 Feb 1, 2022
Social media network with laravel

Social Network Tech Includes Front End: Post CSS Tailwind CSS v3 Back End: Laravel v8 PHP v8 MySQL v8 Asset Bundling: Laravel Mix Features How to use

Noval 3 Apr 20, 2022
Social Network - Social Media App

Social Network Social Network - Social Media App. Demo Features Auth System (Login, Register, Forgot Password, Password Reset & Email Verification) Us

Noval 2 Jan 18, 2022
Pico disk, Not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg

Nano netdisk, Now changed to pico disk. Pico disk,does not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg.

null 53 Dec 26, 2022