问题描述
我正在使用 laravel 8 开发文件系统管理。
我创建了一个接受文件的函数。
public function uploadExperiment(Request $request)
{
$file = $request->file('file');
$uniqueId = time();
$fileName = $file->getClientOriginalName();
$filePath = $uniqueId . '/' . $fileName;
Storage::disk('local')->put($filePath,file_get_contents($file));
return response()->json(["success"=>true]);
}
我需要在上传过程中跟踪上传的大小,这个进度我需要将其保存在数据库中。
例如,如果我想上传大小为 2GB 的文件,则需要时间。那么关于如何跟踪它有什么想法吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)