hgouveia/ng-upload-chunked

Php implementation of the file chunked upload for the angular directive ng-file-upload

Maintainers

👁 hgouveia

Package info

github.com/hgouveia/ng-upload-chunked

pkg:composer/hgouveia/ng-upload-chunked

Statistics

Installs: 1 872

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

v1.0.6 2018-06-06 09:01 UTC

Requires

  • php: >=5.4

Suggests

Provides

None

Conflicts

None

Replaces

None

MIT 1394f114926ddc049faa1258cb33c2eb6d48e4b2

  • Jose De Gouveia <dhgouveia.woop@hotmail.com>

phpuploadchunkedng-file-upload

This package is not auto-updated.

Last update: 2026-06-27 20:58:06 UTC


README

👁 Packagist Version
👁 Build Status
👁 HHVM Build Status
👁 Windows Build Status
👁 FOSSA Status

Php implementation of the file chunked upload for the angular directive ng-file-upload

Note: it could work for any html5 uploader with chunked upload if NgFileChunk is constructed properly

Install

Clone or download this repo, see the example

With Composer

$ composer require hgouveia/ng-upload-chunked

Example of Usage

API doc

Check complete usage in the example folder

<?php
// In your POST handler
/*
 $defaultConfig = [
 "ext" => ".part",
 "fileInputName" => "file",
 "directoryPermission" => 0755,
 "readChunkSize" => 1048576, // 1MB
 "uploadDirectory" => "",
 "tempDirectory" => "",
 ];
*/
$nguc = new \NGUC\NgUploadChunked(); //optional $config param

try {
 // Contains the information of the current chunk
 $chunk = new \NGUC\NgFileChunk(
 $_POST['_uniqueId'],
 $_FILES['file']['name'],
 $_POST['_chunkSize'],
 $_POST['_currentChunkSize'],
 $_POST['_chunkNumber'],
 $_POST['_totalSize'],
 );
 
 // this could be used instead, if ng-file-upload is beign used
 //$chunk = new \NGUC\NgFileChunk();
 //$chunk->populate($_POST['_uniqueId'], $_FILES['file']['name']);

 $nguc->process($chunk);

 // response the path when finished
 if ($nguc->isFinished()) {
 echo $nguc->getUploadPath();
 }

} catch (\NGUC\NGUCException $e) {
 echo "ERROR: " . $e->getCode() . " - " . $e->getMessage();
}

Test

$ ./vendor/bin/peridot test

or if npm is available

$ npm test

License

Read License for more licensing information.

👁 FOSSA Status

Contributing

Read here for more information.