class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
i use laravel , ajax to multi upload file, but there is an error message: "Invalid argument supplied for foreach()" when i use dd($request->file; its print file name successfully
public function upload(Request $request) {
$files = array();
$f=$request->file;
foreach ($f as $k => $l) {
foreach ($l as $i => $v) {
if (!array_key_exists($i, $files))
$files[$i] = array();
$files[$i][$k] = $v;
}
}
but there is an error message: "Invalid argument supplied for foreach()"
when i use dd($request->file; its print file name successfully