Forum


Replies: 7   Views: 3944
Create and download problem
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 seanw  · 29-11-2010 - 19:54

I am trying to create and download a file using $objDocx->fCreateDocxAndDownload('demo1');
However, while the file creates fine, nothing gets downloaded, the screen just fills with rubbish characters, sample: PKV}=e7§îq _rels/.rels­ÁNÃ0 @ï|EäûênH¡¥» ¤Ý*`%n­M¢ÄÀö÷4‰U*hr³c??{»;N£zç”]ðÖU Š½ Öù^Ãkû´º•…¼¥1xÖpâ »æFßö…G’Ò›³*0Ÿ5 "ñ1›'ÊUˆìËOÒDRÂÔc$s žqS×w˜.Ð̘jo5¤½½Õž"_Ã]ç ?ó6±—…ÈGaoÙ®b*ýI\YJµ”z 6˜ç’ÎH1V]„ðÒhÙos½ßï»ãÄB–„ЄÄÛ}U|ëá²Ðú?6¯ø±ùÉ¢=§—5 só PKV}=9²ŸiÓdocProps/app.xmlRËNÃ0¼óQî­Ó !Tm]¡VˆJ p¶ìMbáØ–í"ú÷lšÜð%;³ÞÑÌÆ

What could be wrong that would cause this?
Thanks.

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

Please use createDocxAndDownload with phpdocx 2.0. When you invoke this method some headers are sended to web browser, to open a download window.

Could you write a new comment with php code to try it?.

Posted by seanw  · 11-04-2013 - 12:12

Thanks, this seems to be ok now

Posted by Tangent12  · 11-04-2013 - 12:12

Hi there,

I am having the same problem.
When I use createDocxAndDownload I get the following error:

Fatal error: Call to undefined method CreateDocx::createDocxAndDownload() in /phpdocx/examples/easy/Page.php on line 41

I have downloaded the latest package.

Thanks for your help.

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

Hi Tangent12,

It's not the same error. Method createDocxAndDownload is only available in phpdocx pro version as you can see at

http://www.phpdocx.com/documentation/create_download_docx_word_document

Regards.

Posted by va04459  · 11-04-2013 - 12:12

Hi,

I'm having exactly the same problem. When I use createdocx it creates the file successfully on the server and I can download it and everything looks ok. I need to use createdocxanddowload but when I do it just puts binary information onto the screen.

I downloaded and installed the software just today, Nov 21st. All the tests and creation on the back-end work fine I just can't automatically download the files.

It happens in IE9 and Firefox 17.0.

If anybody can help I'd appreciate it.

Thanks,
Kev.

Posted by kawenga  · 24-01-2014 - 12:29

are you sure you do not send any character to the browser before calling the CreateDocxAndDownload method?