我已经尝试过一些教程,但是它总是给我一条错误消息。如何制作一个控制器脚本以在laravel中上传文件?
请举个例子
$judul = htmlentities($request->post('judul'));
$mdes = htmlentities($request->post('meta_des'));
$kon = htmlentities($request->post('konten'));
$mkey = htmlentities($request->post('meta_key'));
$file = $request->file('gambar');
$name = 'photo-at-'.date('Y-m-dH:i:s').'.'.$file->getClientOriginalExtension();
$path = $file->storeAs('imag e',$name);
return dd($path);
$tgl = date('Y-m-d');
DB::table('article')->insert([
'judul' => $judul,
'pitcures' => date('dmY').'_PITCURE',
'konten' => $kon,
'meta_des' => $mdes,
'meta_key' => $mkey,
'tanggal_tulis' => $tgl
]);
return redirect('/admin/articles.index');
错误消息?
fopen(C:\x\htdocs\public\image/photo-at-2019-05-1311:56:57.dll): failed to open stream: No such file or directory
仅此而已!