PHP code example of mehrdad-dadkhah / php-fine-uploader

1. Go to this page and download the library: Download mehrdad-dadkhah/php-fine-uploader 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/ */

    

mehrdad-dadkhah / php-fine-uploader example snippets


use MehrdadDadkhah\Video\FineUploader;

$uploaderService = new FineUploader();
$uploadResult = $uploaderService->setConfigs(
                'form-input-name',
                'path-to-chunks-folder'
            )
                ->setUniqueIdentifier('unique-identifier')
                ->setDomain('http://example.com') //to set cors header
                ->checkDublicateFile(function($uuid) { //closure function to check file is duplicate or not it should get $uuid as input and return boolean. uuid is a video unique hash
                	return false;
                })
                ->upload('path-to-upload-directory');

$uploadHandeler->setUploadName('my-name.mp4');

$uploadHandeler->checkAndGenerateOutputDirectory();

$uploadHandeler->setTempDirectory('path-to-temp');

$uploadHandeler->setVideoTotalSize(213456);

$uploadHandeler->setMaxUploadSize(213456);

composer