title: PhpSpreadsheet: Permissions | ZipArchive::close(): Failure to create temporary file
body: <p>I would like to offer an Excel-File for download with PhpSpreadsheet</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    require 'vendor/autoload.php';
  
      use PhpOffice\PhpSpreadsheet\Spreadsheet;
      use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
  
      $spreadsheet = new Spreadsheet();
      $sheet = $spreadsheet-&gt;getActiveSheet();
      $sheet-&gt;setCellValue('A1', 'Hello World !');
  
      $writer = new Xlsx($spreadsheet);
      $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
  
      header('Content-Type: application/vnd.ms-excel');
      header('Content-Disposition: attachment; filename="hello_world.xlsx"');
      $writer-&gt;save("php://output");
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>    PHP Warning:  ZipArchive::close(): Failure to create temporary file: No such file or directory in /Users/sg/GitWorkingCopies/xxx1/xxx2/library/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php on line 374
      PHP Fatal error:  Uncaught exception 'PhpOffice\PhpSpreadsheet\Writer\Exception' with message 'Could not close zip file php://output.' in /Users/sg/GitWorkingCopies/xxx1/xxx2/library/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php:375
  </code></pre>
  
  <p>The <a href="https://phpspreadsheet.readthedocs.io/en/develop/topics/recipes/" rel="noreferrer">dokumentation of PHPSpreadsheet</a> says:</p>
  
  <blockquote>
    <p>\PhpOffice\PhpSpreadsheet\Writer\Xlsx uses temporary storage when writing to php://output. By default, temporary files are stored in the script's working directory. When there is no access, it falls back to the operating system's temporary files location.</p>
  </blockquote>
  
  <p>The upload_tmp_dir is: <code>/Applications/XAMPP/xamppfiles/temp/</code></p>
  
  <p>Which folder permissons do I have to check? 
  Or what does cause the problem?</p>