Forum


Replies: 7   Views: 3225
Createdocxanddownload no working
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 pphornet  · 13-01-2013 - 01:40

i create mobile application for iPad and with PHPDocX 2.7 createDocxAndDownload working fine.
But with PHPDocX 3.0 this method no working.
I try from device and from browser. Forever create local file, but from device no downloading and from browser downloading empty file... ((
What i doing not right?
Please, help any advice

Posted by admin  · 11-04-2013 - 12:13

Hello,

To solve this issue, in file CreateDocx.inc change
line 4285, from:

[quote]header('Content-Length: ' . filesize($fileName));[/quote]

to:

[quote]header('Content-Length: ' . filesize($fileName . '.' .
$this->_extension));[/quote]

We're finishing a new version with this bug solved and some other improvements and new features.

Regards.

Posted by pphornet  · 11-04-2013 - 12:13

Gracias!

This line is at No. 4392

I tried change - it does not work
but if you comment out this line - works

Posted by _pierrick_  · 11-04-2013 - 12:13

When do you plan to release the next version ?

Posted by admin  · 11-04-2013 - 12:13

Hello,

The next week.

Regards.

Posted by pphornet  · 11-04-2013 - 12:13

I tried with PHPDocX 3.1 (pro) version and same issue; it’s not fixed yet.
Thanks, pphornet

Posted by admin  · 11-04-2013 - 12:13

Hello,

This line:

header(
'Content-Disposition: attachment; filename="' . $fileNameDownload .
'.' . $this->_extension . '"'
);

has been fixed in the latest version.

Please note that PHPDocX has createDocxAndDownload method to allow the download of the document. But of course, the headers that this method uses depend on your server. We added createDocxAndDownload but if this method doesn't work in your server you can use createDocx and the add a few lines to download the document.

For example if you integrate PHPDocX in Drupal we don't recommend you to use createDocxAndDownload but the included functions in this CMS.

Regards.