当前,我正在laravel中进行CMS,并且尝试将文件上传到laravel中超过2MB,并且它显示该图像无法上传。
我的控制器代码。
$this->validate($request ,[
'title' => 'required',
'featured' => 'required|image',
'content' => 'required',
'category_id' => 'required',
'tags' => 'required'
]);
$featured = $request->featured;
$featured_new_name = $featured->getClientOriginalName();
$featured->move('uploads/posts', $featured_new_name);
$post = Post::create([
'title' => $request->title,
'slug' => str_replace(' ', '-', $request->title),
'featured' => 'uploads/posts/' . $featured_new_name,
'content' => $request->content,
'category_id' => $request->category_id,
'user_id' => Auth::id()
]);
$post->tags()->attach($request->tags);
Session::flash('success', 'Post Created Sucessfully.');
return redirect()->route('posts');
答案 0 :(得分:3)
答案 1 :(得分:3)
增加php.ini中的内存限制是最好的主意。 如果您只是想增加此函数的内存限制,请在函数上使用此代码。
OCI-Lob::write(): ORA-01031: insufficient privileges
答案 2 :(得分:1)