0
我想將我上傳的文件存儲在特定文件夾中,而不是存儲在de/storage文件夾中。將文件上傳到另一個目錄laravel 5
public function upload(Request $request) {
$files = $request->file('file');
foreach ($files as $file):
Storage::put($file->getClientOriginalName(), file_get_contents($file));
endforeach;
我試圖做到這一點,但它不工作:
public function upload(Request $request) {
$selectfolder = \Request::get('selectfolder');
$files = $request->file('file');
foreach ($files as $file):
storage_path(). "/download/". $selectfolder::put($file->getClientOriginalName(), file_get_contents($file));
endforeach;
Laravel給出了這樣的錯誤:
語法錯誤,意想不到的 '::'(T_PAAMAYIM_NEKUDOTAYIM)