PHPackages                             alirdn/secureupload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. alirdn/secureupload

ActiveLibrary

alirdn/secureupload
===================

PHP secure file upload package

3292PHP

Since Feb 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/alirdn/SecureUPload)[ Packagist](https://packagist.org/packages/alirdn/secureupload)[ RSS](/packages/alirdn-secureupload/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

SecureUPload – PHP secure file upload package [![Build Status](https://camo.githubusercontent.com/c00a8b4ec79be3d765fbd501252a0c6904afb9cd852f1ec74d969f6a6cd38c58/68747470733a2f2f7472617669732d63692e6f72672f616c6972646e2f53656375726555506c6f61642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alirdn/SecureUPload)
======================================================================================================================================================================================================================================================================================================================================

[](#secureupload--php-secure-file-upload-package-)

[![SecureUPload – PHP secure file upload package banner](resources/banner-big.png?raw=true "SecureUPload – PHP secure file upload package banner")](resources/banner-big.png?raw=true)**SecureUPload** is a PHP composer package to securely upload files. SecureUPload uses best practices for uploading files in PHP, so you can use it without any file upload security headaches. Furthermore, it’s flexible enough that fits to most of different projects structures.

Why SecureUPload?
-----------------

[](#why-secureupload)

File upload is a risky part in all web applications. There are multiple ways that an attacker could attack web application by file upload feature. So whenever a web application wants to add this feature, developers needs to write lots of code for make it risk free. But file uploads could be secure, if we don’t trust users provided data (including HTTP headers and files) and check everything carefully. For more information about file upload risks please see: [OWASP Unrestricted File Upload](https://www.owasp.org/index.php/Unrestricted_File_Upload)

SecureUPload uses best practices steps for making a file upload secure. By using SecureUpload package, developer can focuses on other aspects of project and be sure about file uploads.

Features
--------

[](#features)

- Single and multiple input file/files upload support
- Support storing uploaded files in different location. For more info see storage\_type SecureUPloadConfig section
- Support different uploaded files organization
- Configure accepted upload file types and minimum/maximum file size globally or upload specific
- Zero dependency for production
- Different error codes for invalid uploaded files for better error handling

Installation
------------

[](#installation)

Because SecureUPload has zero dependency, it can be installed as a composer package, or without composer and as a PHP library.

### Install as composer package

[](#install-as-composer-package)

```
$ composer install alirdn/secureupload
```

### Install as PHP library

[](#install-as-php-library)

You must download it from project github page. Then unzip it and include src/autoloader.php file in your PHP project. All done!

Basic Usage
-----------

[](#basic-usage)

```
