Forum


Replies: 2   Views: 3612
Replacevariablebyhtml with downloadimages works only on lan !
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 Diagamter  · 17-02-2015 - 11:12

Hello, I have a problem with my phpdocx. My code is OK when I execute it via Local network, 'replaceVariableByHTML' function downloads images, and inserts it in my docx. But when I use the same code (same server) but access it via Internet route, 'replaceVariableByHTML' do the job for the style part, but images are not downloaded ! I precise I use absolute path, and the content I try to insert is well displayed in the web browser... I precise also that images added to docx with 'replacePlaceholderImage' are OK If anyone has an idea of what I can check... Thanks by advance.

Posted by admin  · 17-02-2015 - 15:02

Hello, Please run the example Templates/replaceVariableByHTML/sample_1.php, included within the package. It downloads images from an external URL; check if when you run the sample the images are in the DOCX. Regards.

Posted by Diagamter  · 17-02-2015 - 16:41

OK... Your code is fine ;) I apologize, my problem was due to my config and not to your component :) I asked from client to generate file with "my.server.com" which is a local DNS redirection for tests purpose... So, my server when not connected locally (LAN name) did not know where to download 'http://my.server.com/img.png' And of course, when I checked my logs, the images URL were correct !! (from client...) With a line in /etc/hosts to redirect my.server.com to itself its OK now... I can continue testing :) sorry for inconvenience !