gpt4 book ai didi

phpoffice - 无法从 url phpoffice/spreadsheet 加载文件

转载 作者:行者123 更新时间:2023-12-02 22:24:37 26 4
gpt4 key购买 nike

尝试从 url 加载 .xlsx 文件,但出现如下错误:

Fatal error: Uncaught InvalidArgumentException: File 
"http://localhost/test/csvfile/samplesms.xlsx" does not exist. in
D:\wamp\www\test\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Shared\File.php on line 137

使用以下方式加载文件,

 $filename = "http://localhost/test/csvfile/samplesms.xlsx";
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
$reader->setReadDataOnly(TRUE);
$spreadsheet = $reader->load($filename);

文件已位于给定位置。

最佳答案

phpoffice/spreadsheet 不支持从 URL 加载。

关于phpoffice - 无法从 url phpoffice/spreadsheet 加载文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49382469/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com