protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request)
    {
        // get basic container stuff
        $chunkManager = $this->container->get('oneup_uploader.chunk_manager');

        // get information about this chunked request
        [$last, $uuid, $index, $orig] = $this->parseChunkedRequest($request);

        $chunk = $chunkManager->addChunk($uuid, $index, $file, $orig);

        if (null !== $chunk) {
            $this->dispatchChunkEvents($chunk, $response, $request, $last);
        }

        if ($chunkManager->getLoadDistribution()) {
            $chunks = $chunkManager->getChunks($uuid);
            $assembled = $chunkManager->assembleChunks($chunks, true, $last);

            if (null === $chunk) {
                $this->dispatchChunkEvents($assembled, $response, $request, $last);
            }
        }

        // if all chunks collected and stored, proceed
        // with reassembling the parts
        if ($last) {
            if (!$chunkManager->getLoadDistribution()) {
                $chunks = $chunkManager->getChunks($uuid);
                $assembled = $chunkManager->assembleChunks($chunks, true, true);
            }

            $path = $assembled->getPath();

            $this->handleUpload($assembled, $response, $request);

            $chunkManager->cleanup($path);
        }
    }
protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request)
    {
        // get basic container stuff
        $chunkManager = $this->container->get('oneup_uploader.chunk_manager');

        // get information about this chunked request
        [$last, $uuid, $index, $orig] = $this->parseChunkedRequest($request);

        $chunk = $chunkManager->addChunk($uuid, $index, $file, $orig);

        if (null !== $chunk) {
            $this->dispatchChunkEvents($chunk, $response, $request, $last);
        }

        if ($chunkManager->getLoadDistribution()) {
            $chunks = $chunkManager->getChunks($uuid);
            $assembled = $chunkManager->assembleChunks($chunks, true, $last);

            if (null === $chunk) {
                $this->dispatchChunkEvents($assembled, $response, $request, $last);
            }
        }

        // if all chunks collected and stored, proceed
        // with reassembling the parts
        if ($last) {
            if (!$chunkManager->getLoadDistribution()) {
                $chunks = $chunkManager->getChunks($uuid);
                $assembled = $chunkManager->assembleChunks($chunks, true, true);
            }

            $path = $assembled->getPath();

            $this->handleUpload($assembled, $response, $request);

            $chunkManager->cleanup($path);
        }
    }
protected function handleChunkedUpload ( UploadedFile $ file , ResponseInterface $ response , Request $ request ) { // get basic container stuff $ chunkManager = $ this -> container -> get ( 'oneup_uploader.chunk_manager' ) ; // get information about this chunked request [ $ last , $ uuid , $ index , $ orig ] = $ this -> parseChunkedRequest ( $ request ) ; $ chunk = $ chunkManager -> addChunk ( $ uuid , $ index , $ file , $ orig ) ; if ( null !== $ chunk ) { $ this -> dispatchChunkEvents ( $ chunk , $ response , $ request , $ last ) ; } if ( $ chunkManager -> getLoadDistribution ( ) ) { $ chunks = $ chunkManager -> getChunks ( $ uuid ) ; $ assembled = $ chunkManager -> assembleChunks ( $ chunks , true , $ last ) ; if ( null === $ chunk ) { $ this -> dispatchChunkEvents ( $ assembled , $ response , $ request , $ last ) ; } } // if all chunks collected and stored, proceed // with reassembling the parts if ( $ last ) { if ( ! $ chunkManager -> getLoadDistribution ( ) ) { $ chunks = $ chunkManager -> getChunks ( $ uuid ) ; $ assembled = $ chunkManager -> assembleChunks ( $ chunks , true , true ) ; } $ path = $ assembled -> getPath ( ) ; $ this -> handleUpload ( $ assembled , $ response , $ request ) ; $ chunkManager -> cleanup ( $ path ) ; } }
This function will be called in order to upload and save an
uploaded chunk.

This function also calls the chunk manager if the function
parseChunkedRequest has set true for the "last" key of the
returned array to reassemble the uploaded chunks.

@param UploadedFile      $file     - The uploaded chunk
@param responseInterface $response - A response object
@param Request           $request  - The request object
This function will be called in order to upload and save an uploaded chunk .