1. Go to this page and download the library: Download heryfitiavana/rcu-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
heryfitiavana / rcu-laravel example snippets
use Heryfitiavana\RCU\Controllers\UploadController;
Route::get('/uploadStatus', [UploadController::class, 'uploadStatus']);
Route::post('/upload', [UploadController::class, 'upload']);
$customConfig = [
"store" => new JsonStoreProvider('rcu/uploads.json'),
"tmpDir" => "rcu/tmp",
"outputDir" => "rcu/output",
"onCompleted" => function ($data) {
},
];
use Illuminate\Support\ServiceProvider;
use Heryfitiavana\RCU\Controllers\RCUControllerFactory;
use Heryfitiavana\RCU\Controllers\UploadController;
use Heryfitiavana\RCU\StoreProviders\JsonStoreProvider;
class AppServiceProvider extends ServiceProvider
{
public function register()
{
// other ...
$this->app->singleton(UploadController::class, function ($app) {
$customConfig = [
"store" => new JsonStoreProvider('rcu/uploads.json'),
"tmpDir" => "rcu/tmp",
"outputDir" => "rcu/output",
"onCompleted" => function ($data) {
},
];
return RCUControllerFactory::createController($customConfig);
});
}
public function boot()
{
}
}
[
"store" => new JsonStoreProvider('rcu/uploads.json'),
"tmpDir" => "rcu/tmp",
"outputDir" => "rcu/output",
"onCompleted" => function ($data) {
},
]
Upload = [
"id" => string,
"chunkCount" => int,
"lastUploadedChunkNumber": int,
"chunkFilenames": string[],
];
interface StoreProviderInterface
{
public function getItem(String $id) : Upload | undefined;
public function createItem(String $id, Int $chunkCount): Upload;
public function updateItem(String $id, Upload $update) : Upload;
public function removeItem(String $id) : void;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.