public function registerUser(Request $request)
 {
     $sessionUserData = $this->app['session'];
     $entityManager = $this->app['doctrine'];
     $user = new User();
     $user->setUserName($request->request->get('userName'));
     $user->setUserEmail($request->request->get('userEmail'));
     $user->setPassword($request->request->get('userPassword'));
     $user->setOfficeLocation($request->request->get('officeLocation'));
     $user->setUserAddress($request->request->get('userAddress'));
     try {
         $entityManager->persist($user);
         $entityManager->flush();
         if (null !== $request->files->get('resumeFile')) {
             $fs = new FileHandler();
             $fs->fileUpload($request->files->get('resumeFile'), $user->getId(), UPLOAD_PATH);
         }
         $sessionUserData->getFlashBag()->add('alert_success', 'Registration successful');
         return $this->app->redirect(BASEPATH . "/login");
     } catch (UniqueConstraintViolationException $ex) {
         $sessionUserData->getFlashBag()->add('alert_danger', 'Sorry, this email id is already registered!');
         return $this->app->redirect(BASEPATH . "/register");
     }
 }
 public function downloadFile($filename)
 {
     $fileHandler = new FileHandler();
     $fileResponse = $fileHandler->downloadExistingFile($filename, UPLOAD_PATH);
     if (!$fileResponse) {
         return $this->app->redirect(BASEPATH . '/usersetting');
     } else {
         return $fileResponse;
     }
 }