aVadim483 / fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP
MIT License
142 stars 26 forks source link

After generating an excel file, the tmp file doesn't get deleted automatically #64

Closed elidon555 closed 3 weeks ago

elidon555 commented 1 month ago

The issue is that these files do not get deleted automatically after php script execution ends, is there a way to make it possible after the xlsx file is generated?

root@148e277b1331d8:/tmp# ls -la total 7564624 drwxrwxrwt 1 root root 12288 Jun 1 15:00 . drwxr-xr-x 1 root root 4096 May 31 14:02 .. -rw------- 1 root root 7057 May 31 14:28 wsdl-www-data-00676d6e4fc76048aeb10601d35fdce146 -rw-r--r-- 1 root root 41041 May 31 14:09 xlsx_writer_6659da066ab8a_6659da09baa360.15830223.tmp -rw-r--r-- 1 root root 209923233 May 31 14:31 xlsx_writer_6659da066ab8a_6659da6af348a4.39058811.tmp -rw-r--r-- 1 root root 41041 May 31 14:09 xlsx_writer_6659da144d291_6659da185b5b30.01516584.tmp -rw-r--r-- 1 root root 209923233 May 31 14:31 xlsx_writer_6659da144d291_6659da7a45c654.86541082.tmp -rw-r--r-- 1 root root 41041 May 31 15:09 xlsx_writer_6659e8165c186_6659e819e7c7f6.57713283.tmp

aVadim483 commented 1 month ago

which version of fast-excel-writer?

elidon555 commented 1 month ago

which version of fast-excel-writer?

v5.3.1

atmanegara commented 1 month ago

https://github.com/aVadim483/fast-excel-writer/issues/63#issue-2329799742

In my problem, I used download() and an error occurred when opening the downloaded file, my solution was to make changes to the file .../FastExcelWriter/Excel.php in the public function download(), after "readfile($tmpFile)" I add the code

unlink($tmpFile); exit;

to delete temporary and it works fine

elidon555 commented 1 month ago

#63 (comment)

In my problem, I used download() and an error occurred when opening the downloaded file, my solution was to make changes to the file .../FastExcelWriter/Excel.php in the public function download(), after "readfile($tmpFile)" I add the code

unlink($tmpFile); exit;

to delete temporary and it works fine

my issue is a bit different

i successfully generated the file, stored on my s3, but it was not deleted on the /tmp directory

atmanegara commented 1 month ago

my issue is a bit different

i successfully generated the file, stored on my s3, but it was not deleted on the /tmp directory

yes, maybe you can add an unlink($tmpFile)

aVadim483 commented 3 weeks ago

@elidon555 @atmanegara please, update up to v.5.4 and give me feedback