Please I am having issues displaying images on the MS-Word document I create dynamically from my php script; I have seen similar questions on SO, sadly they do not solve my problem. Am relatively new to using headers. Please heeeelp! :(
Heres some code to help you guys out:
$image64 = base64_encode(file_get_contents('res/myLogo.png'));
header('Content-type: image/jpeg');
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=document_name.doc");
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=Windows1252\">";
echo "<body>";
echo "<b>My Document Header</b>";
echo '<img src="data:image/jpg;base64,'.$image64.'">';
echo "</body>";
echo "</html>";
The image displays and works fine when I echo it out to a html page, however when the document downloads, the image is not displayed. Thanks ahead.