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();
}

}

点赞

发表回复

电子邮件地址不会被公开。必填项已用 * 标注