Level 50
try this
$rep->storeAs('/public/reportAttachment',$filename);
I am trying to move a file which will be uploaded to public/foldername but i get this error of failed to open stream: Permission denied. Kindly tell me how to solve this error
Code of file uploading
if(!empty($rep))
{
foreach($rep as $rep)
{
$filename = $rep->getClientOriginalName();
$fileSize = $rep->getClientSize();
$rep->storeAs('public/reportAttachment',$filename);
$reportId = Report::where('reportId',$request->reportId)->first();
$reportA = new ReportAttachment;
$reportA->reportAttachmentFile = $filename;
$reportA->report_id = $reportId->id;
$reportA->save();
}
}
try this
$rep->storeAs('/public/reportAttachment',$filename);
Please or to participate in this conversation.