public function postMediaAction(Request $request)
    {
        $response = $this->getFilter($request);
        if ($response['success'] === false) {
            return $response['value'];
        }
        $filter = $response['value'];

        $mm = $this->getMediaManager();

        $media = $mm->create();
        $media
            ->setFilter($filter)
            ->setCryptedFilter($response['crypted'])
            ;

        if (!$request->files->has('file')) {
            return new Response($this->get('translator')->trans('error.fileNotFound', array(), 'ApoutchikaMediaBundle'), 500);
        }

        $media->setFile($request->files->get('file'));

        if ($mm->save($media) === false) {
            $error = $mm->getError();

            return new Response($this->get('translator')->trans($error[0], $error[1], 'ApoutchikaMediaBundle'), 500);
        }

        return $this->createResponse($media, $request->request->has('iframe'));
    }