PHPackages                             resumable2/resumable.js-php-server - 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. resumable2/resumable.js-php-server

ActiveLibrary

resumable2/resumable.js-php-server
==================================

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

v2.0.0(1y ago)2456441[13 issues](https://github.com/resumable2/resumable.js-php-server/issues)[1 PRs](https://github.com/resumable2/resumable.js-php-server/pulls)MITPHPPHP &gt;=8.0

Since Oct 4Pushed 1y ago20 watchersCompare

[ Source](https://github.com/resumable2/resumable.js-php-server)[ Packagist](https://packagist.org/packages/resumable2/resumable.js-php-server)[ RSS](/packages/resumable2-resumablejs-php-server/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)DependenciesVersions (12)Used By (0)

flow.js php server [![Build Status](https://camo.githubusercontent.com/75f82c0ff573149e36dded528f7406338eca32aed3e8b19ce9e136c68eb74e33/68747470733a2f2f7472617669732d63692e6f72672f666c6f776a732f666c6f772d7068702d7365727665722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/flowjs/flow-php-server) [![Coverage Status](https://camo.githubusercontent.com/940701149833b1ac9cee30d6053b5b1d7cfb337d75cddfca0ed1bb33f630c2f9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f666c6f776a732f666c6f772d7068702d7365727665722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/flowjs/flow-php-server?branch=master)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#flowjs-php-server--)

PHP library for handling chunk uploads. Library contains helper methods for:

- Testing if uploaded file chunk exists.
- Validating file chunk
- Creating separate chunks folder
- Validating uploaded chunks
- Merging all chunks to a single file

This library is compatible with HTML5 file upload library:

How to get started?
-------------------

[](#how-to-get-started)

Setup Composer:

Run this command in your project:

```
composer require flowjs/flow-php-server

```

This will create a vendor directory for you, which contains an autoload.php file.

Create a new php file named `upload.php`:

```
//Path to autoload.php from current location
require_once './vendor/autoload.php';

$config = new \Flow\Config();
$config->setTempDir('./chunks_temp_folder');
$request = new \Flow\Request();
$uploadFolder = './final_file_destination/'; // Folder where the file will be stored
$uploadFileName = uniqid()."_".$request->getFileName(); // The name the file will have on the server
$uploadPath = $uploadFolder.$uploadFileName;
if (\Flow\Basic::save($uploadPath, $config, $request)) {
  // file saved successfully and can be accessed at $uploadPath
} else {
  // This is not a final chunk or request is invalid, continue to upload.
}
```

Make sure that `./chunks_temp_folder` path exists and is writable. All chunks will be saved in this folder.

If you are stuck with this example, please read this issue: [How to use the flow-php-server](https://github.com/flowjs/flow-php-server/issues/3#issuecomment-46979467)

Advanced Usage
--------------

[](#advanced-usage)

```
$config = new \Flow\Config();
$config->setTempDir('./chunks_temp_folder');
$file = new \Flow\File($config);

if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    if ($file->checkChunk()) {
        header("HTTP/1.1 200 Ok");
    } else {
        header("HTTP/1.1 204 No Content");
        return ;
    }
} else {
  if ($file->validateChunk()) {
      $file->saveChunk();
  } else {
      // error, invalid chunk upload request, retry
      header("HTTP/1.1 400 Bad Request");
      return ;
  }
}
if ($file->validateFile() && $file->save('./final_file_name')) {
    // File upload was completed
} else {
    // This is not a final chunk, continue to upload
}
```

Delete unfinished files
-----------------------

[](#delete-unfinished-files)

For this you should setup cron, which would check each chunk upload time. If chunk is uploaded long time ago, then chunk should be deleted.

Helper method for checking this:

```
\Flow\Uploader::pruneChunks('./chunks_folder');
```

Cron task can be avoided by using random function execution.

```
if (1 == mt_rand(1, 100)) {
    \Flow\Uploader::pruneChunks('./chunks_folder');
}
```

Contribution
------------

[](#contribution)

Your participation in development is very welcome!

To ensure consistency throughout the source code, keep these rules in mind as you are working:

- All features or bug fixes must be tested by one or more specs.
- Your code should follow [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding style guide

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 71.1% 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

Every ~408 days

Recently: every ~747 days

Total

11

Last Release

516d ago

Major Versions

v0.2.1 → v1.0.02015-02-01

v1.2.0 → v2.0.02024-12-09

PHP version history (3 changes)v1.0.0PHP &gt;=5.4

v1.0.1PHP &gt;=5.3

v2.0.0PHP &gt;=8.0

### Community

---

Top Contributors

[![AidasK](https://avatars.githubusercontent.com/u/2088484?v=4)](https://github.com/AidasK "AidasK (69 commits)")[![daniel-sc](https://avatars.githubusercontent.com/u/117919?v=4)](https://github.com/daniel-sc "daniel-sc (16 commits)")[![ImanMh](https://avatars.githubusercontent.com/u/4482199?v=4)](https://github.com/ImanMh "ImanMh (3 commits)")[![mattwells](https://avatars.githubusercontent.com/u/507858?v=4)](https://github.com/mattwells "mattwells (1 commits)")[![olegabr](https://avatars.githubusercontent.com/u/2850808?v=4)](https://github.com/olegabr "olegabr (1 commits)")[![phpfui](https://avatars.githubusercontent.com/u/7434059?v=4)](https://github.com/phpfui "phpfui (1 commits)")[![rhynodesigns](https://avatars.githubusercontent.com/u/2198266?v=4)](https://github.com/rhynodesigns "rhynodesigns (1 commits)")[![roibeart](https://avatars.githubusercontent.com/u/16907384?v=4)](https://github.com/roibeart "roibeart (1 commits)")[![taichiroendo](https://avatars.githubusercontent.com/u/17469206?v=4)](https://github.com/taichiroendo "taichiroendo (1 commits)")[![Yousha](https://avatars.githubusercontent.com/u/18091267?v=4)](https://github.com/Yousha "Yousha (1 commits)")[![aidas-orbio](https://avatars.githubusercontent.com/u/261227772?v=4)](https://github.com/aidas-orbio "aidas-orbio (1 commits)")[![jamoy](https://avatars.githubusercontent.com/u/1748565?v=4)](https://github.com/jamoy "jamoy (1 commits)")

### Embed Badge

![Health badge](/badges/resumable2-resumablejs-php-server/health.svg)

```
[![Health](https://phpackages.com/badges/resumable2-resumablejs-php-server/health.svg)](https://phpackages.com/packages/resumable2-resumablejs-php-server)
```

PHPackages © 2026

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