0

I've sent an image from client side(Angular) to symfony. The upload works fine with small size images but when I try to upload a big size one (more than 2.0 mb) it does not work and shows me this error:

The "" file does not exist or is not readable. in vendor/symfony/mime/FileinfoMimeTypeGuesser.php (line 52)

     $data = json_decode($request->getContent(), true);
     $uploadedImage=$request->files->get('mainIMG'); 

           /**
             * @var UploadedFile $image
            */

        $image=$uploadedImage;
        $imageName=md5(uniqid()).'.'.$image->guessExtension();
        $image->move($this->getParameter('avatar_dir'),$imageName);
Bill P
  • 3,622
  • 10
  • 20
  • 32
  • 1
    Possible duplicate of https://stackoverflow.com/questions/2184513/change-the-maximum-upload-file-size – Mike Doe Sep 04 '19 at 12:33
  • As @emix pointed, it may be the case that you have to adjust PHP's configuration to allow uploads for larger files. See https://stackoverflow.com/a/2184541/461992 – wowpatrick Sep 04 '19 at 12:37
  • Actually i did what u have mentioned but still the same error – Ahmed Hrabi Sep 04 '19 at 13:27
  • It somehow works after restarting my computer maybe when u edit the php.ini file u need to restart the apache ! – Ahmed Hrabi Sep 04 '19 at 14:49

0 Answers0