项目背景
汇付创建实名认证的对象
需要上传对应资质文件
$value; // 上传的文件路径 /uploads/attach/2023/11/20231123/v2.1.3-20231030.zip
$local_path = realpath(public_path() . $value);
$filename_temp = explode('/', $value);
$data[$field] = new \CURLFile($local_path, getmimefile($local_path), end($filename_temp) ?? $value);
$file_upload = true;
function getmimefile($file)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$ftype = finfo_file($finfo, $file);
finfo_close($finfo);
return $ftype;
}
参考资料
本文由 ben 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Jul 8, 2024 at 06:09 pm