While uploading CSV file in laravel, am getting the error saying
"Symfony \ Component \ HttpFoundation \ File \ Exception \ FileException The file "DealProducts.csv" was not uploaded due to an unknown error".
$folder = 'owner';
$path1 = base_path('resources/importedfiles/' . $folder . '/');
File::makeDirectory($path1, 0777, true, true);
$file = request()->file('file_name');
$fileName = md5($file->getClientOriginalName()) . '_' . date('Y-m-d H:i:s') . '.csv';
$uploadingPath = asset('resources/importedfiles/' . $folder . '/');
if ($file->move($path1, $fileName)) {
$offers = $request->get('offers');
ImportFile::create([
'file_name' => $fileName,
'file_size' => round($file->getClientSize() / (1024 * 1024), 2),
'offer_id' => $offers,
]);
}
return redirect('/admin/importfiles');
$uploadingPath, but you're not using it. Why?