0

I'm trying to build a script that will write data to an excel file before sending an email. I'm using PHPSpreadsheet for this, but the initial example is throwing an error. Can someone please let me know where I'm going wrong and how I can fix it.

A PHP Error was encountered
Severity: Warning

Message: ZipArchive::close(): Failure to create temporary file: Permission denied

Filename: Writer/Xlsx.php

Line Number: 374

Backtrace:

File: /Library/WebServer/Documents/Projects/app/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php
Line: 374
Function: close

 File: /Library/WebServer/Documents/Projects/app/application/controllers/Login.php
Line: 52
Function: save

File: /Library/WebServer/Documents/Projects/app/index.php
Line: 323
Function: require_once

An uncaught Exception was encountered
Type: PhpOffice\PhpSpreadsheet\Writer\Exception

Message: Could not close zip file helloworld.xlsx.

 Filename: /Library/WebServer/Documents/Projects/app/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php

  Line Number: 375

  Backtrace:

 File: /Library/WebServer/Documents/Projects/app/application/controllers/Login.php
 Line: 52
 Function: save

 File: /Library/WebServer/Documents/Projects/app/index.php
 Line: 323
 Function: require_once

P.S. I'm using Codeigniter and my dev machine is a macbook and server is Ubuntu16.04 on AWS.

Danish Ali
  • 2,354
  • 3
  • 15
  • 26
Krish
  • 401
  • 6
  • 18

0 Answers0