Php 使用laravel上载大文件时出错
当我上传2MB左右的文件时,它可以工作,但当我上传2+MB的文件时会出错 我有一个基于Laravel 5的应用程序,具有文件上传功能。1.我尝试插入图像(jpeg、bmp、png)和文件(Docx、xlsx、pdf),这样当大小在2MB左右时一切都可以正常工作 但是当我上传20+MB文件时出错有人知道错误在哪里吗 我的代码Php 使用laravel上载大文件时出错,php,laravel-5,Php,Laravel 5,当我上传2MB左右的文件时,它可以工作,但当我上传2+MB的文件时会出错 我有一个基于Laravel 5的应用程序,具有文件上传功能。1.我尝试插入图像(jpeg、bmp、png)和文件(Docx、xlsx、pdf),这样当大小在2MB左右时一切都可以正常工作 但是当我上传20+MB文件时出错有人知道错误在哪里吗 我的代码 public function rules() { return [ 'proposition' => 'required', ];
public function rules()
{
return [
'proposition' => 'required',
];
$filename = count($this->input('filename'));
foreach(range(0, $filename) as $index) {
$rules['filename.' . $index] = 'required|mimes:pdf,jpeg,bmp,png,doc,docx,csv,xlsx|max:20000';
}
return $rules;
}
我的职能
public function store(PropositionRequest $request)
{
$proposition = new Proposition();
$prop = Proposition::create($request->all());
$prop->saveTags($request->get('tags'));
foreach ($request->filename as $filename) {
var_dump($filename);
$filename = $filename->store('filename');
PropositionFiles::create([
'proposition_id' => $prop->num_proposition,
'filename' => $filename
]);
}
可能的重复告诉我们与的区别?默认上载限制为2mb,因此您看到的行为。我将上载最大文件大小更改为100 MB,但仍然无法工作。。与此相同的错误是,MimeTypeGuesser.php第123行中的FileNotFoundException:除了上载\u max\u filesize外,文件“”不存在。。。同时更改post_最大尺寸