env file maa
main_path=/public/
and while file upload store fn:
but from using public_path directly, system will auto take public path
main_path=/public/
and while file upload store fn:
if(!empty($request->file('image')))
{
$file=$request->file('image');
$path=base_path().env('main_path').'event_upload';
// $path=public_path().'/event_upload';
//wrong method :
// $path=base_path().'/public/event_upload';
$name=uniqid().'_'.$file->getClientOriginalName();
if($file->move($path,$name))
{
$image=$name;
}
}
but from using public_path directly, system will auto take public path
Comments
Post a Comment