public function sendLogoPdf(Request $request, $databox_id)
    {
        try {
            if (null !== ($file = $request->files->get('newLogoPdf')) && $file->isValid()) {

                if ($file->getClientSize() < 65536) {
                    $databox = $this->findDataboxById($databox_id);
                    $this->getApplicationBox()->write_databox_pic(
                        $this->app['media-alchemyst'],
                        $this->app['filesystem'],
                        $databox,
                        $file,
                        \databox::PIC_PDF
                    );
                    unlink($file->getPathname());

                    return $this->app->redirectPath('admin_database', [
                        'databox_id' => $databox_id,
                        'success'    => '1',
                    ]);
                } else {
                    return $this->app->redirectPath('admin_database', [
                        'databox_id' => $databox_id,
                        'success'    => '0',
                        'error'      => 'file-too-big',
                    ]);
                }
            } else {
                return $this->app->redirectPath('admin_database', [
                    'databox_id' => $databox_id,
                    'success'    => '0',
                    'error'      => 'file-invalid',
                ]);
            }
        } catch (\Exception $e) {
            return $this->app->redirectPath('admin_database', [
                'databox_id' => $databox_id,
                'success'    => '0',
                'error'      => 'file-error',
            ]);
        }
    }
public function sendLogoPdf(Request $request, $databox_id)
    {
        try {
            if (null !== ($file = $request->files->get('newLogoPdf')) && $file->isValid()) {

                if ($file->getClientSize() < 65536) {
                    $databox = $this->findDataboxById($databox_id);
                    $this->getApplicationBox()->write_databox_pic(
                        $this->app['media-alchemyst'],
                        $this->app['filesystem'],
                        $databox,
                        $file,
                        \databox::PIC_PDF
                    );
                    unlink($file->getPathname());

                    return $this->app->redirectPath('admin_database', [
                        'databox_id' => $databox_id,
                        'success'    => '1',
                    ]);
                } else {
                    return $this->app->redirectPath('admin_database', [
                        'databox_id' => $databox_id,
                        'success'    => '0',
                        'error'      => 'file-too-big',
                    ]);
                }
            } else {
                return $this->app->redirectPath('admin_database', [
                    'databox_id' => $databox_id,
                    'success'    => '0',
                    'error'      => 'file-invalid',
                ]);
            }
        } catch (\Exception $e) {
            return $this->app->redirectPath('admin_database', [
                'databox_id' => $databox_id,
                'success'    => '0',
                'error'      => 'file-error',
            ]);
        }
    }
public function sendLogoPdf ( Request $ request , $ databox_id ) { try { if ( null !== ( $ file = $ request -> files -> get ( 'newLogoPdf' ) ) && $ file -> isValid ( ) ) { if ( $ file -> getClientSize ( ) < 65536 ) { $ databox = $ this -> findDataboxById ( $ databox_id ) ; $ this -> getApplicationBox ( ) -> write_databox_pic ( $ this -> app [ 'media-alchemyst' ] , $ this -> app [ 'filesystem' ] , $ databox , $ file , \ databox :: PIC_PDF ) ; unlink ( $ file -> getPathname ( ) ) ; return $ this -> app -> redirectPath ( 'admin_database' , [ 'databox_id' => $ databox_id , 'success' => '1' , ] ) ; } else { return $ this -> app -> redirectPath ( 'admin_database' , [ 'databox_id' => $ databox_id , 'success' => '0' , 'error' => 'file-too-big' , ] ) ; } } else { return $ this -> app -> redirectPath ( 'admin_database' , [ 'databox_id' => $ databox_id , 'success' => '0' , 'error' => 'file-invalid' , ] ) ; } } catch ( \ Exception $ e ) { return $ this -> app -> redirectPath ( 'admin_database' , [ 'databox_id' => $ databox_id , 'success' => '0' , 'error' => 'file-error' , ] ) ; } }
Set a new logo for a databox

@param  Request $request    The current HTTP request
@param  integer $databox_id The requested databox
@return RedirectResponse
Set a new logo for a databox