thinkphp5.1表单内有多个单文件时报错 SplFileObject::__construct(/tmp/php1Xk2Qu): failed to open stream: No such file or directory

找到源文件thinkphplibrarythinkFile.php
在构造函数内加个判断
if(file_exists($filename))

    public function __construct($filename, $mode = 'r')
    {
        if(file_exists($filename)){

            parent::__construct($filename, $mode);

            $this->filename = $this->getRealPath() ?: $this->getPathname();
        }
    }

木点点 i
请先登录后发表评论
  • 最新评论
  • 总共0条评论