Forum


Replies: 5   Views: 3161
Createdocxanddownload
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 Walter Florencio  · 05-12-2014 - 17:56

Durante os testes consigo salvar o arquivo teste_template no meu servidor da web, no entanto gostaria que ao enviar o comando para a criação do arquivo .docx, o mesmo fosse aberto automaticamente. Pesquisando na documentação ví que deve se usar o createDocxAndDownload, no entanto a aplicação fica processando indefinidamente e não abre o arquivo. O que pode estar errado? abaixo os códigos para análise: *============== ... $docx = new CreateDocxFromTemplate('../ModelosWord/mod_APFD_Comu_Juiz_Sem_Fianca.docx'); $docx->replaceVariableByText($variables); $docx->createDocx('../ModelosWord/test_template'); *============= Com este código o arquivo teste_template é criado no servidor web. *============== ... $docx = new CreateDocxFromTemplate('../ModelosWord/mod_APFD_Comu_Juiz_Sem_Fianca.docx'); $docx->replaceVariableByText($variables); $docx->createDocxAndDownload('../ModelosWord/test_template'); *============= Com este código o arquivo teste_template é criado no servidor web, porém não abre de forma automática.

Posted by admin  · 08-12-2014 - 08:13

Hello, Please explains your issue in english. Regards.

Posted by Walter Florencio  · 08-12-2014 - 22:31

During testing I save the teste_template file on my web server , however I would that sending the command to create the .docx file, it would open automatically. Searching the saw documentation should use the createDocxAndDownload , however the application is suing indefinitely and does not open the file. What could be wrong ? codes for the analysis below : *============== ... $docx = new CreateDocxFromTemplate('../ModelosWord/mod_APFD_Comu_Juiz_Sem_Fianca.docx'); $docx->replaceVariableByText($variables); $docx->createDocx('../ModelosWord/test_template'); //With this teste_template code file is created on the web server *============= *============== ... $docx = new CreateDocxFromTemplate('../ModelosWord/mod_APFD_Comu_Juiz_Sem_Fianca.docx'); $docx->replaceVariableByText($variables); $docx->createDocxAndDownload('../ModelosWord/test_template'); //With this code the teste_template file is created on the web server , but does not open automatically. *=============

Posted by admin  · 09-12-2014 - 07:44

Hello, Please post your web server, if you are using a CMS or framework where you use the library, and what do you mean by ' the application is suing indefinitely'. Regards.

Posted by Walter Florencio  · 09-12-2014 - 13:34

My web server is www.hoo.st and use the Scriptcase as CMS

Posted by admin  · 10-12-2014 - 07:47

Hello, Sorry but we don't know what could be happening on your server. You'd need to check your server logs, add the mime/type for DOCX files in your server config: application/vnd.openxmlformats-officedocument.wordprocessingml.document and use the create createDocx standalone, and then write a custom download method. The included method may not work in some specific cases. Regards.