Reputation: 377
I'm using php-export-data.class.php, in which the temporary file is not writeable and throws some warning
Warning: rename(/tmp/exportdatauC7PtH,/report/saleslist.xls): No such file or directory in /var/www/html/excel/php-export-data.class.php on line 60
here is my code:
$this->tempFilename = tempnam(sys_get_temp_dir(), 'exportdata');
$this->tempFile = fopen($this->tempFilename, "w");
and my line 60 is.
rename($this->tempFilename, $this->filename);
I tried giving permission 755
and 777
to my /tmp
directory but the file is not writing.
Thanks
Upvotes: 1
Views: 2075
Reputation: 137467
You need to create all intermediate directories.
In order to rename a file to /tmp/exportdatauC7PtH,/report/saleslist.xls
, you need to first ensure that the directory /tmp/exportdatauC7PtH,/report/
exists.
Upvotes: 1