/** * Check multipart headers. * * @param Request $request * @param array $headers * @throws \SRIO\RestUploadBundle\Exception\UploadProcessorException */ protected function checkHeaders(Request $request, array $headers = array()) { list($contentType) = $this->parseContentTypeAndBoundary($request); $expectedContentType = 'multipart/related'; if ($contentType != $expectedContentType) { throw new UploadProcessorException(sprintf('Content-Type must be %s', $expectedContentType)); } parent::checkHeaders($request, array('Content-Type', 'Content-Length')); }
/** * Constructor. * * @param \SRIO\RestUploadBundle\Upload\StorageHandler $storageHandler * @param EntityManager $em * @param string $resumableEntity */ public function __construct(StorageHandler $storageHandler, EntityManager $em, $resumableEntity) { parent::__construct($storageHandler); $this->em = $em; $this->resumableEntity = $resumableEntity; }