<form action="uploading.php" method="POST" enctype="multipart/form-data">
<input type="file" name="image_path[]">
</form>
$files = $request->file('image_path');
//upload multipal file one row diffrent name with seprate comma
$i = 0;
if($request->hasfile('image_path')){
foreach ($files as $file) {
// $name = $file->getClientOriginalName();
//with $i help you save diffrent name file
$name = time() . $i . '.' . $file->getClientOriginalExtension();
//movie file in folder location
$file->move(public_path().'/backend/image/',$name);
$datavk[] = $name;
//save data in database with diffrent name with comma
$user->document_name = implode(",",$datavk);
$i++;
}
}
0 comments:
Post a Comment
Thanks