PHPackages                             simp/uploader - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. simp/uploader

ActiveLibrary[File &amp; Storage](/categories/file-storage)

simp/uploader
=============

This is for uploading file in system

v1.0.0(1y ago)0642MITPHP

Since Mar 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CHANCENY/file-uploads)[ Packagist](https://packagist.org/packages/simp/uploader)[ RSS](/packages/simp-uploader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (2)

The provided PHP-based file upload system offers two primary methods for handling file uploads:

1. **URL-based Uploads**: Allows users to upload files by providing a direct URL.
2. **Form-based Uploads**: Enables users to upload files through an HTML form.

The system is designed with extensibility and security in mind, utilizing traits and base classes to promote code reuse and maintainability.

Key Components
--------------

[](#key-components)

### 1. Traits

[](#1-traits)

**a. `Properties` Trait**

This trait encapsulates common properties used across different uploader classes, such as:

- `$original_url`
- `$parse_filename`
- `$parse_filesize`
- `$file_type`
- `$system_filename`
- `$allowed_extensions`
- `$allowed_max_size`
- `$temp_object`
- `$file_object`
- `$validated`

By defining these properties in a trait, the system ensures consistency and reduces redundancy across uploader classes.

**b. `CommonFunction` Trait**

This trait provides common methods shared among uploader classes, including:

- `addAllowedExtension(string $mime_type = 'image/*'): self`
- `addAllowedMaxSize(int $allowed_max_size = 500000): self`
- `getExtensionFromMime($mime_type)`

These methods facilitate setting allowed file extensions, specifying maximum file sizes, and determining file extensions based on MIME types.

### 2. Base Classes

[](#2-base-classes)

**a. `UrlUploader` Class**

Handles file uploads via direct URLs. Key functionalities include:

- Setting the original URL.
- Validating the file by fetching headers to determine MIME type and size.
- Downloading the file content.
- Saving the file to a specified destination.

**b. `FormUploader` Class**

Manages file uploads through HTML forms. Its responsibilities encompass:

- Validating the uploaded file's MIME type and size.
- Moving the uploaded file to a designated directory.

### 3. Example Implementations

[](#3-example-implementations)

**a. `Url.php`**

An example implementation of the `UrlUploader` class. It demonstrates how to:

- Initialize the uploader.
- Set allowed file extensions and maximum size.
- Add a URL and validate the file.
- Move the validated file to the desired location.

**b. `Form.php`**

An example implementation of the `FormUploader` class. It illustrates how to:

- Initialize the uploader.
- Set allowed file extensions and maximum size.
- Validate the uploaded file.
- Move the validated file to the target directory.

### 4. User Interfaces

[](#4-user-interfaces)

**a. `index.php`**

Provides a user interface for URL-based uploads. Users can input a direct URL to upload a file.

**b. `form.php`**

Offers a user interface for form-based uploads. Users can select and upload files from their local system.

Usage Instructions
------------------

[](#usage-instructions)

### URL-based Uploads

[](#url-based-uploads)

1. **Access the URL Upload Interface**:

    - Navigate to `index.php` in your web browser.
2. **Provide the File URL**:

    - Enter the direct URL of the file you wish to upload.
3. **Upload Process**:

    - The system will validate the file's MIME type and size.
    - If valid, the file will be downloaded and saved to the specified directory.

### Form-based Uploads

[](#form-based-uploads)

1. **Access the Form Upload Interface**:

    - Navigate to `form.php` in your web browser.
2. **Select and Upload a File**:

    - Choose a file from your local system that meets the validation criteria.
    - Submit the form to upload the file.
3. **Upload Process**:

    - The system will validate the uploaded file's MIME type and size.
    - If valid, the file will be moved to the designated directory.

Developer Notes
---------------

[](#developer-notes)

- **Extensibility**: The use of traits (`Properties` and `CommonFunction`) promotes code reuse and simplifies the addition of new uploader types. Developers can create new uploaders by combining these traits with specific functionalities.
- **Validation**: Both `UrlUploader` and `FormUploader` classes emphasize rigorous validation to ensure that only files meeting the specified criteria are processed. This enhances security and reliability.
- **Customization**: Developers can easily adjust allowed file extensions and maximum file sizes using the provided methods in the `CommonFunction` trait.
- **Error Handling**: Implement robust error handling to manage upload failures gracefully. Ensure that appropriate messages are displayed to users in case of validation failures or other issues.

By understanding and utilizing these components, developers can effectively implement and customize the file upload system to meet specific application requirements.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance44

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

436d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6097a3277a85cf902ab5d617af1515359091563d1d288dd969e59ca50646a782?d=identicon)[Chance007](/maintainers/Chance007)

---

Top Contributors

[![CHANCENY](https://avatars.githubusercontent.com/u/96126430?v=4)](https://github.com/CHANCENY "CHANCENY (3 commits)")

### Embed Badge

![Health badge](/badges/simp-uploader/health.svg)

```
[![Health](https://phpackages.com/badges/simp-uploader/health.svg)](https://phpackages.com/packages/simp-uploader)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
