Answers for "Laravel store multiple files"

PHP
0

Laravel store multiple files

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!');
        }
    }
Posted by: Guest on December-05-2020

Code answers related to "Laravel store multiple files"

Browse Popular Code Answers by Language