Download the PHP package resumable/chunked-uploader without Composer

On this page you can find all versions of the php package resumable/chunked-uploader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chunked-uploader

Resumable Chunked Uploader

PHP Version PHPUnit

Enterprise-grade, framework-agnostic PHP 8.2 library for handling large file uploads via chunking with constant-memory stream assembly, resume capability, and cryptographic integrity checks.

Chunks are persisted independently, progress is kept in a durable store (Redis or a relational database), and the final file is assembled using native PHP streams — never buffering the whole file into memory, regardless of how large it is.


Table of contents


Highlights


Architecture

Data flow for a single chunk:


Core benefits

Benefit How it works
Low memory Assembly streams chunk-by-chunk through a fixed 4 MiB buffer. A 10 GB file needs under 10 MiB of PHP memory.
Resumable Progress persists per-chunk. Any client can query missing indices and resume exactly where it stopped.
Idempotent Re-sending an already-accepted chunk is a no-op — no duplicated bytes, no corruption.
Secure Magic-byte MIME checks, HMAC token verification, traversal-safe paths, and optional ClamAV scanning.
Out-of-order safe Chunks may arrive in any order; assembly only runs when every index is present.

Installation

Requirements:


Standalone PHP quickstart

Create one Chunk per HTTP request. index is zero-based. Retrying an already-accepted index is safe and idempotent.


Framework integration

Laravel 10 / 11

1. Register the service provider

In bootstrap/providers.php (Laravel 11) or config/app.php (Laravel 10):

2. Publish configuration (optional)

Then adjust config/chunk-uploader.php (allowed MIME types, spool directory, storage driver, etc.).

New in this version: token_salt (binds tokens to a client fingerprint), virus_scanning (ClamAV host/port), and rate_limiting (Redis-backed chunk flood protection) — all with matching .env variable names (see the config file for the full list).

3. Use the Facade

4. Add routes (see the example controller)

A complete, copy-pasteable controller lives at examples/laravel/ChunkUploadController.php.


Symfony 6 / 7

1. Enable the bundle

2. Configure the bundle

3. Add routes via attribute on the controller

The example at examples/symfony/ChunkUploadController.php uses attribute routing and constructor injection, so no routing YAML is needed.


Vanilla JavaScript client

A 100% dependency-free ES6+ client, using Blob.prototype.slice(), the Fetch API and FormData, is included in examples/vanilla-js/.

Features:

Open examples/vanilla-js/index.html in a browser for a ready-to-run drag-and-drop demo.


Security model

  1. TokensUploadTokenService issues HMAC-SHA256 tokens bound to the upload identifier, chunk count, total size, and an optional client salt (IP / fingerprint). Verification uses hash_equals() (constant-time).
  2. PathsPathSanitizer rejects null bytes, directory separators, traversal markers (.., ../), and unsafe identifiers. Never build a filesystem path from user input without running it through the sanitizer.
  3. MIMEMagicByteValidator inspects only the first 4096 bytes via finfo and compares against an allow-list. Client-supplied MIME headers are never trusted.
  4. Extension matchingExtensionMimeMatchRule rejects files whose claimed extension disagrees with their detected MIME type.
  5. MalwareClamAvScanner streams data to clamd over the INSTREAM protocol in 1 MiB chunks. Use NullVirusScanner when scanning is handled elsewhere.
  6. AbuseRedisRateLimiter can key limits per IP, user, or upload token and applies them before accepting chunk bodies.
  7. Storage — Keep temporary and final directories outside the public document root, and configure permissions and retention deliberately.

API reference

ChunkUploaderInterface

Method Description
processChunk(Chunk $chunk): UploadState Validates the token, persists the chunk, advances progress, and assembles when complete. Idempotent and concurrent-safe.
cancelUpload(string $identifier): void Removes chunks and metadata. Idempotent for unknown identifiers.
getStatus(string $identifier): ?UploadState Reads the current state of an upload, or null if unknown.

Chunk (readonly DTO)

identifier, token, index, totalChunks, chunkSize, totalSize, tmpFilePath, originalFilename, and optional checksum.

UploadState (readonly DTO)

identifier, totalChunks, totalSize, originalFilename, uploadedChunks, isCompleted, finalPath; plus hasChunk(), isComplete(), withUploadedChunk(), and withFinalPath().

Contracts

Contract Methods
ChunkStorageInterface store, getChunkStream, deleteChunks, cleanOrphanedChunks
MetadataRepositoryInterface save, get, delete, markChunkAsUploaded, cleanExpired
ProgressTrackerInterface getPercentage, isComplete, getMissingChunkIndices
FileAssemblerInterface assemble(UploadState, ChunkStorageInterface): string
ValidationRuleInterface validate(Chunk): void
ChunkValidatorInterface validate(Chunk): bool
VirusScannerInterface scan(string): void
EventDispatcherInterface dispatch(object): object

Endpoint-specific attributes

Global Laravel or Symfony configuration remains the default. A controller method can opt into a narrower immutable configuration for its own uploads:

The core resolver accepts either a ReflectionMethod or ReflectionClass and returns the unchanged global instance when no attribute is present.

Configuration options

Setting Default Description
maxChunkSize 5 MiB Hard limit of a single chunk.
maxFileSize 100 MiB Hard limit of the assembled file.
maxChunks 1000 Max chunks per upload (DoS guard).
allowedMimeTypes [] Whitelist; empty = any verified type.
spoolDirectory /tmp/chunked-uploader Chunk + final assembly dir.
garbageCollectionTtl 3600 s Incomplete-upload window before GC.
identifierPattern ^[a-zA-Z0-9_-]{1,128}$ Legal identifier pattern.
tokenSalt '' Optional HMAC salt bound to client context.
virusScanning disabled ClamAV host/port (requires virus_scanning.enabled: true).
rateLimiting disabled Redis-backed chunk-flood guard (max_attempts, decay_seconds, key).

Testing

The full suite runs completely offline: all disk I/O uses ephemeral temporary files that are cleaned up automatically; storage and metadata are in-memory doubles (FakeRedis, FakePdo); and Redis, S3, and ClamAV are never contacted. The suite covers:

License

MIT. See LICENSE.


All versions of chunked-uploader with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
psr/event-dispatcher Version ^1.0
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package resumable/chunked-uploader contains the following files

Loading the files please wait ...