慕容的工作随笔

慕容的工作随笔

记录学习和工作

thinkphp5.1 多文件上传报错 SplFileObject::__construct(/tmp/phpvfQPvQ)解决方法 转

转自https://blog.csdn.net/qq_40270754/article/details/85005353

分析:这个不是上传文件的最大值的问题,而是由于linux系统自动清除临时文件的愿意造成的

 

thinkphp\library\think\File.php 的构造函数加个判断
if(file_exists($filename))
简单解决报错可以让你用起来
不知道有没有其他其他不良影响

 

public function __construct($filename, $mode = ‘r’)
{

if(file_exists($filename)){
parent::__construct($filename, $mode);
$this->filename = $this->getRealPath();
}

}

评论 (0)

还没有评论,来做第一个吧。

发表评论

提交后需管理员审核通过后显示