我被困在这里,如何解决这个问题"由于Laravel 5.3"中的未知错误,文件未上传? 当我上传三个以上的图像比我面对这个错误,但当我上传一个或两个图像,然后它就可以了。图像也保存在文件夹和数据库中。
FileException in UploadedFile.php line 235:
The file "boy-clipart.png" was not uploaded due to an unknown error.
以下是代码:
if ($request->hasFile('path')) {
$files = $request->file('path');
foreach($files as $file){
$filename = $file->getClientOriginalName();
$picture = rand(10,100)."-".$filename;
$file->move(public_path('product-images'), $picture,filesize(public_path('product-images')), null, true);
$productImage = new ProductImages();
$productImage->product_id = $product->id;
$productImage->path = $picture;
$productImage->sortorder = $sortorder;
$productImage->save();
}
}
请帮忙。