Controller/MediaController.php
public function uploadFileChunked($fileData, $name, $chunk, $chunks, $fileId, $categoryId, $title = null)
        {
            $parameters = [
            'query' => [
                'name' => $name,
                'chunk' => $chunk,
                'chunks' => $chunks,
                'fileId' => $fileId,
                'categoryId' => $categoryId,
                'title' => $title,
            ],
            'multipart' => [
                [
                    'name' => 'file',
                    'contents' => \GuzzleHttp\Psr7\stream_for($fileData),
                    'filename' => $name,
                ],
            ],
            'headers' => null,
        ];
            $result = $this->post('v1/media.json', $parameters);

            return $result;
        }
public function uploadFileChunked($fileData, $name, $chunk, $chunks, $fileId, $categoryId, $title = null)
        {
            $parameters = [
            'query' => [
                'name' => $name,
                'chunk' => $chunk,
                'chunks' => $chunks,
                'fileId' => $fileId,
                'categoryId' => $categoryId,
                'title' => $title,
            ],
            'multipart' => [
                [
                    'name' => 'file',
                    'contents' => \GuzzleHttp\Psr7\stream_for($fileData),
                    'filename' => $name,
                ],
            ],
            'headers' => null,
        ];
            $result = $this->post('v1/media.json', $parameters);

            return $result;
        }
public function uploadFileChunked ( $ fileData , $ name , $ chunk , $ chunks , $ fileId , $ categoryId , $ title = null ) { $ parameters = [ 'query' => [ 'name' => $ name , 'chunk' => $ chunk , 'chunks' => $ chunks , 'fileId' => $ fileId , 'categoryId' => $ categoryId , 'title' => $ title , ] , 'multipart' => [ [ 'name' => 'file' , 'contents' => \ GuzzleHttp \ Psr7 \ stream_for ( $ fileData ) , 'filename' => $ name , ] , ] , 'headers' => null , ] ; $ result = $ this -> post ( 'v1/media.json' , $ parameters ) ; return $ result ; }
Upload a new media to QBank.

This upload endpoint has been specifically tailored to fit chunked uploading (works well with Plupload2 for example). Max chunk size is about 10mb, if your files are larger than this, split it up and set correct chunk and chunks argument in the call.
For example a 26mb file might be split in 3 chunks, so the following 3 calls should be made
POST /media.json?chunks=3&chunk=0&filename=largefile.txt&categoryId=1 (file data is sent in body)
POST /media.json?chunks=3&chunk=1&filename=largefile.txt&categoryId=1&fileId=<fileId from first call> (file data is sent in body)
POST /media.json?chunks=3&chunk=2&filename=largefile.txt&categoryId=1&fileId=<fileId from first call> (file data is sent in body)

@param  mixed  $fileData   the file's data content
@param  string $name       Filename of the file being uploaded
@param  int    $chunk      The chunk we are currently uploading, starts at 0
@param  int    $chunks     Number of chunks you will be uploading, when (chunk - 1) == chunks the file will be considered uploaded
@param  string $fileId     A unique fileId that will be used for this upload, if none is given one will be given to you
@param  int    $categoryId The category to place the file in
@param  string $title      Title which will represent the media in search results etc
@return array
Upload a new media to QBank .