📜  Laravel 存储多个文件 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:25.983000             🧑  作者: Mango

代码示例1
public function fileUpload(Request $request)
    {
        if ($request->hasfile('filenames')) {
            foreach ($request->file('filenames') as $file) {
                $name = $file->getClientOriginalName();
                $file->move(public_path() . '/mytestfile/', $name);
                $data[] = $name;
            }
            return back()->with('Success!','Data Added!');
        }
    }