File upload in Laravel application hosted in shared hosting
I host a Laravel application in a shared hosting. I put the project files like this:
/public_html - contains the public files of Laravel app
/core_app - contains all files except the public folder of the Laravel app
During development, everything is fine for me in uploading images. But in shared hosting, it happens an error in uploading images.
Here is what the error message says:
Whoops, looks like something went wrong.
(1/1) LogicException
Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)
in MimeTypeGuesser.php (line 135)
at MimeTypeGuesser->guess('/tmp/phpC0Akib')
in File.php (line 79)
at File->getMimeType()
in File.php (line 58)
at File->guessExtension()
in ValidatesAttributes.php (line 926)
.....
You are right!
My server's PHP version was 5.6.32. I upgrade it to 7.0.0 and activate php_fileinfo. It works fine in image upload to /core_app/public/images but not to /public_html/images.
I went one step through your help. I need additional help in this issue. Thanks in advance.
my php version and everything is fine. When I upload a file, the route gets stored in the database but no image is uploaded in my storage on the hosted website which is on my cpanel. may someone help.