Skip to content

Commit

Permalink
Fix image upload
Browse files Browse the repository at this point in the history
  • Loading branch information
orgimeno committed Nov 21, 2020
1 parent 7fecd28 commit 35b97f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/AppBundle/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public function editAction(Request $request){
&& $name != null
&& $surname != null){

$user->setImage($image);
$user->setRole($role);
$user->setEmail($email);
$user->setName($name);
Expand Down Expand Up @@ -239,8 +238,8 @@ public function uploadImageAction(Request $request){
if(!empty($file) && $file != null){
$ext = $file->guessExtension();

if($ext == 'jpg' || $ext == 'gif'
|| $ext = 'jpeg' || $ext = 'png'){
if($ext === 'jpg' || $ext === 'gif'
|| $ext === 'jpeg' || $ext === 'png'){
$file_name = time().".".$ext;
$file->move("uploads/users", $file_name);

Expand Down

0 comments on commit 35b97f5

Please sign in to comment.