private function processCustomUploadHandler(Request $request, array $handler)
    {
        list($namespace, $prefix) = $this->parser($handler[0]);
        $this->app['upload.namespace'] = $namespace;
        $this->app['upload.prefix'] = $prefix;

        // Do the upload
        $fullResult = $this->handleUploadFiles($request, $namespace);

        array_shift($handler);
        $original = $namespace;

        if (count($fullResult)) {
            $result = $fullResult[0];
            foreach ($handler as $copy) {
                list($namespace, $prefix) = $this->parser($copy);

                $this->filesystem()->put(
                    $namespace . '://' . $prefix . basename($result['name']),
                    $this->filesystem()->read($original . '://' . $result['name'])
                );
            }
        }

        return $this->json($fullResult, Response::HTTP_OK, ['Content-Type' => 'text/plain']);
    }
private function processCustomUploadHandler(Request $request, array $handler)
    {
        list($namespace, $prefix) = $this->parser($handler[0]);
        $this->app['upload.namespace'] = $namespace;
        $this->app['upload.prefix'] = $prefix;

        // Do the upload
        $fullResult = $this->handleUploadFiles($request, $namespace);

        array_shift($handler);
        $original = $namespace;

        if (count($fullResult)) {
            $result = $fullResult[0];
            foreach ($handler as $copy) {
                list($namespace, $prefix) = $this->parser($copy);

                $this->filesystem()->put(
                    $namespace . '://' . $prefix . basename($result['name']),
                    $this->filesystem()->read($original . '://' . $result['name'])
                );
            }
        }

        return $this->json($fullResult, Response::HTTP_OK, ['Content-Type' => 'text/plain']);
    }
private function processCustomUploadHandler ( Request $ request , array $ handler ) { list ( $ namespace , $ prefix ) = $ this -> parser ( $ handler [ 0 ] ) ; $ this -> app [ 'upload.namespace' ] = $ namespace ; $ this -> app [ 'upload.prefix' ] = $ prefix ; // Do the upload $ fullResult = $ this -> handleUploadFiles ( $ request , $ namespace ) ; array_shift ( $ handler ) ; $ original = $ namespace ; if ( count ( $ fullResult ) ) { $ result = $ fullResult [ 0 ] ; foreach ( $ handler as $ copy ) { list ( $ namespace , $ prefix ) = $ this -> parser ( $ copy ) ; $ this -> filesystem ( ) -> put ( $ namespace . '://' . $ prefix . basename ( $ result [ 'name' ] ) , $ this -> filesystem ( ) -> read ( $ original . '://' . $ result [ 'name' ] ) ) ; } } return $ this -> json ( $ fullResult , Response :: HTTP_OK , [ 'Content-Type' => 'text/plain' ] ) ; }
This handles the more advanced functionality where multiple upload handlers
are provided. Only the first one is returned as a result, the result
of this first upload is then attempted to copy to the remaining handlers.

@param Request $request
@param array   $handler

@return \Symfony\Component\HttpFoundation\JsonResponse
This handles the more advanced functionality where multiple upload handlers are provided . Only the first one is returned as a result the result of this first upload is then attempted to copy to the remaining handlers .