Forum


Replies: 3   Views: 3545
Trying to replaceplaceholderimage from aws
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 kdiamond  · 13-04-2015 - 20:42

Any way to replace a placeholder with an image stored on AWS instead of local space? example - here is a publicly readable jpg file: http://eventreports.s3.amazonaws.com/events/2875/M5nZ7D4w.JPG When I use replace template variable with HTML, I get an error: mb_convert_encoding(): Unable to detect character encoding in /var/www/html/libraries/phpdocx/lib/dompdfParser/include/parserhtml.cls.php on line 380 using this line in my php script: $docx->replaceVariableByHTML('DISPLAY', 'inline', "$photo2", array('isFile' => true, 'parseDivsAsPs' => false,'downloadImages' => true)); Thanks in advance

Posted by admin  · 14-04-2015 - 06:30

Hello, The image is not public. When we open the URL with a browser we get the message Access Denied. Regards.

Posted by kdiamond  · 15-04-2015 - 00:29

My apologies, in testing I changed the file to .jpeg after I posted http://eventreports.s3.amazonaws.com/events/2875/M5nZ7D4w.JPEG This one works for me I won't change it.

Posted by admin  · 15-04-2015 - 08:57

Hello, The problem is that AWS doesn't show the image, it downloads the image directly. You just need to use the file_get_contents to save it in your FS to add it with phpdocx. Regards.