Forum


Replies: 1   Views: 3495
Createdocxanddownload($sfilename) - file is saved on server, too
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by KRav  · 16-07-2016 - 16:54

Hi there, 

I use 

$this->oDocx->createDocxAndDownload($sFileName);

to download the file, it works, but the file ist stored on server, too.

To download the file I use this JS.

                    $('#reportBtn').on('click', function (e) {
                        e.preventDefault();
                        $(this).prop('disabled', true);
                        var _iframe_dl = $('<iframe />')
                            .attr('src', url)
                            .hide()
                            .appendTo('body');
                    })

Did someone has a suggestion, why this is happen?

Cheers

KR

Posted by admin  · 17-07-2016 - 11:37

Hello,

The createDocxAndDownload method creates and downloads the DOCX, but it doesn't remove the file. Please use unlink (http://php.net/manual/es/function.unlink.php) after the document has been generated to remove it.

Regards.