使用laravel和mamp将较大的文件上载到mysql数据库时无法连接

cs7cruho  于 2021-06-18  发布在  Mysql
关注(0)|答案(0)|浏览(171)

我有一个问题,当上传文件到我的apache服务器,导航器不断显示消息连接已重置。我尝试了小文件(100kb),它的工作很好,但当我尝试500kb或更多的文件连接被重置。。。
以下是我的php.ini上传设置:
上传\最大\文件大小=320m
内存限制=12800m
最大输入时间=6000
最大执行时间=3000
立柱最大尺寸=300m
默认\u套接字\u超时=600
表格代码:

<form enctype="multipart/form-data" method="POST" action="{{ url('FruitCreate') }}" >
{{ csrf_field() }}
<input type="text" name='name'>
<input type="text" name='price'>
<input type="hidden" name="MAX_FILE_SIZE" value="30000000" />
<input type="file" name='image'>
<select name='quantitytype'>
    <option value='unity'> unity </option>
    <option value='kg'> kg </option>
</select>   

<button type='submit'> submit </button>

这是我的控制器,用于向数据库输入新行:

class fruitController extends Controller
public function createFruit(Request $request){
$file = $request->file('image'); 

$fruit = new fruit;

$imageContent = $file->openFile()->fread($file->getSize()); 
$fruit = new fruit;
$fruit->picture = $imageContent;
$fruit->name = $request->name;
$fruit->quantitytype = $request->quantitytype;
$fruit->price = $request->price; 
$fruit->save();
return redirect('FruitsChangingPricePanel');
//

谢谢你的帮助!!!!!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题