src/Slashworks/AppBundle/Controller/CustomerController.php
private function _handleLogoUpload(Request &$request, Customer &$oCustomer)
        {

            $sLogoPath = "";

            /** @var FileBag $t */
            $oFiles      = $request->files;
            $aFiles      = $oFiles->get("slashworks_appbundle_customer");
            $sUploadPath = __DIR__ . "/../../../../web/files/customers";

            if (isset($aFiles['logo'])) {
                if (!empty($aFiles['logo'])) {
                    /** @var UploadedFile $oUploadedFile */
                    $oUploadedFile = $aFiles['logo'];

                    $sUniqId   = sha1(uniqid(mt_rand(), true));
                    $sFileName = $sUniqId . '.' . $oUploadedFile->guessExtension();

                    $oUploadedFile->move($sUploadPath, $sFileName);
                    $sLogoPath = $sFileName;
                }
            }


            return $sLogoPath;
        }
private function _handleLogoUpload(Request &$request, Customer &$oCustomer)
        {

            $sLogoPath = "";

            /** @var FileBag $t */
            $oFiles      = $request->files;
            $aFiles      = $oFiles->get("slashworks_appbundle_customer");
            $sUploadPath = __DIR__ . "/../../../../web/files/customers";

            if (isset($aFiles['logo'])) {
                if (!empty($aFiles['logo'])) {
                    /** @var UploadedFile $oUploadedFile */
                    $oUploadedFile = $aFiles['logo'];

                    $sUniqId   = sha1(uniqid(mt_rand(), true));
                    $sFileName = $sUniqId . '.' . $oUploadedFile->guessExtension();

                    $oUploadedFile->move($sUploadPath, $sFileName);
                    $sLogoPath = $sFileName;
                }
            }


            return $sLogoPath;
        }
private function _handleLogoUpload ( Request & $ request , Customer & $ oCustomer ) { $ sLogoPath = "" ; /** @var FileBag $t */ $ oFiles = $ request -> files ; $ aFiles = $ oFiles -> get ( "slashworks_appbundle_customer" ) ; $ sUploadPath = __DIR__ . "/../../../../web/files/customers" ; if ( isset ( $ aFiles [ 'logo' ] ) ) { if ( ! empty ( $ aFiles [ 'logo' ] ) ) { /** @var UploadedFile $oUploadedFile */ $ oUploadedFile = $ aFiles [ 'logo' ] ; $ sUniqId = sha1 ( uniqid ( mt_rand ( ) , true ) ) ; $ sFileName = $ sUniqId . '.' . $ oUploadedFile -> guessExtension ( ) ; $ oUploadedFile -> move ( $ sUploadPath , $ sFileName ) ; $ sLogoPath = $ sFileName ; } } return $ sLogoPath ; }
Handle Logo uplaod

@param \Symfony\Component\HttpFoundation\Request $request
@param \Slashworks\AppBundle\Model\Customer      $oCustomer

@return string
Handle Logo uplaod