SonataMediaBundle: The file “” does not exist 500

2019-07-18 07:32发布

问题:

I uploaded some files using the SonataMediaBundle but when i wanted to add another, i got that error.

Have you any idea ?

this is the stack error:

in /var/www/znata.com/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php at line 107  -+

        public function guess($path)
        {
            if (!is_file($path)) {
                throw new FileNotFoundException($path);
            }
            if (!is_readable($path)) {

Thanks

回答1:

Probably caused because your php.ini settings has a max uploaded size set.

Change this to a higher value in your php.ini

upload_max_filesize = 2M


回答2:

he can't found the file if (!is_file($path)) { throw new FileNotFoundException($path); }

i think you must to reinstanciate the file for the second one



回答3:

You might face a similar error if you're form doesn't have the attribute: enctype="multipart/form-data"