PhpSpreadsheet: Permissions | ZipArchive::close(): Failure to create temporary file

前端 未结 3 623
梦毁少年i
梦毁少年i 2021-01-18 10:53

I would like to offer an Excel-File for download with PhpSpreadsheet

Here is my code:

    require \'vendor/autoload.php\';

    use PhpOffice\\PhpSpr         


        
3条回答
  •  不要未来只要你来
    2021-01-18 11:22

    The issue was the tmp directory used by phpSpreadSheet and that was not writable by PHP process. I changed the tmp directory to upload tmp directory and now the issue is resolved. I solved the issue using

    \PhpOffice\PhpSpreadsheet\Shared\File::setUseUploadTempDirectory(true);
    

提交回复
热议问题