src/Controller/Api/MediaController.php
public function getMediumBinaryAction($id, $format, Request $request)
    {
        $media = $this->getMedium($id);

        $response = $this->mediaPool->getProvider($media->getProviderName())->getDownloadResponse($media, $format, $this->mediaPool->getDownloadMode($media));

        if ($response instanceof BinaryFileResponse) {
            $response->prepare($request);
        }

        return $response;
    }
public function getMediumBinaryAction($id, $format, Request $request)
    {
        $media = $this->getMedium($id);

        $response = $this->mediaPool->getProvider($media->getProviderName())->getDownloadResponse($media, $format, $this->mediaPool->getDownloadMode($media));

        if ($response instanceof BinaryFileResponse) {
            $response->prepare($request);
        }

        return $response;
    }
public function getMediumBinaryAction ( $ id , $ format , Request $ request ) { $ media = $ this -> getMedium ( $ id ) ; $ response = $ this -> mediaPool -> getProvider ( $ media -> getProviderName ( ) ) -> getDownloadResponse ( $ media , $ format , $ this -> mediaPool -> getDownloadMode ( $ media ) ) ; if ( $ response instanceof BinaryFileResponse ) { $ response -> prepare ( $ request ) ; } return $ response ; }
Returns media binary content for each format.

@ApiDoc(
requirements={
{"name"="id", "dataType"="integer", "requirement"="\d+", "description"="media id"},
{"name"="format", "dataType"="string", "description"="media format"}
},
statusCodes={
200="Returned when successful",
404="Returned when media is not found"
}
)

@param int     $id      The media id
@param string  $format  The format
@param Request $request

@return Response
Returns media binary content for each format .