0
I was with my local Laravel project, and I use this code to save my images:
$request->profile_photo->storeAs('empresas/perfil', $filename, 'public');
Now I hosted my project, to host I needed to take out the folder public
from the root of the project, it stays at the same level of the project and is called public_html
.
When saving an image shows the following error:
(1/1) Errorexception fopen(/Storage/ssd3/972/3511972/public_html): failed to open stream: Is a directory in Filesystemadapter.php (line 160) At Handleexceptions->handleError(2, 'fopen(/Storage/ssd3/972/3511972/public_html): failed to open stream: Is a directory', '/Storage/ssd3/972/3511972/Laravel/vendor/Laravel/framework/src/Illuminate/Filesystem/Filesystemadapter.php', 160, array('path' => '../companies/profile', 'file' => Object(Uploadedfile), 'name' => 'Laravel_foto_perfiliuyuieatwaygmailcom_teste.jpg', 'options' => array()) at fopen('/Storage/ssd3/972/3511972/public_html', 'r+') in Filesystemadapter.php (line 160)
What I need to change to fix the problem??
You have configured the
filesystem.php
in the briefcaseconfig
? and gave write permission in folders?– novic
'disks' => [
 'local' => [
 'driver' => 'local',
 'root' => storage_path('app'),
 ],

 'public' => [
 'driver' => 'local',
 'root' => storage_path('app/public'),
 'url' => env('APP_URL').'/storage',
 'visibility' => 'public',
 ],

I think the problem is right here, as I do for him to get a folder that is not at the root of the project?– Jonathan Lopes
storage_path('app/public')
shouldn’t bestorage_path('app/public_html')
when setting changes have to be careful with the total.– novic
I made that change, and I tried several others and nothing, continues with the same mistake.
– Jonathan Lopes
Gave permission ... ???
– novic