-2
I’m having a hard time with a Portable project, version of the 8.x. I deployed the project outside of public_html and everything of the project that was in the public folder I put inside the public_html of the server. but in the project when making an upload it falls into the project folder that is outside public_html so I cannot access these files. because the view can’t find the file.
Tree that uploads:
$filenameWithExt = $request->file('foto')->getClientOriginalName();
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
$extension = $request->file('foto')->getClientOriginalExtension();
$fileNameToStore = $filename.'_'.time().'.'.$extension;
$path = $request->file('foto')->storeAs('public/upload', $fileNameToStore);
$data['foto'] = $fileNameToStore;
Trexo that is in the view:
src="{{asset('storage/upload/' . $user->foto)}}"
Folder structure
--project
----app
----public
----Storage
----the other folder of Laravel
--public_html
----the files from the public folder of the Laravel
got it... I did it this way Because that’s the way I saw it most in the content I researched. Thanks so much for the answer.
– Romulo Xavier