Link to home
Start Free TrialLog in
Avatar of JS List
JS ListFlag for United States of America

asked on

Asp.Net Save as Word Doc with Pictures

Hello,
I have a page that is being saved as a .docx file.  Works good.  Problem is it has a company logo in it that isn't coming thru to the word file.  I can see the logo in my browser.

On the .aspx page I have
<%Response.AddHeader("Content-Disposition", "Attachment;Filename=" & thisFileNumber & "_Universal_Single.doc")
  Response.ContentType = "application/vnd.ms-word"%>

Works Great.  On the same page I have
<table width="653" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="497" valign="top"><table width="653" border="0">
      <tr>
        <td width="216"><font size="2" face="Tahoma, Arial, verdana">
            <asp:Image ID="Image2" runat="server" ImageUrl="http://Intranet/Images/Logo.jpg" width="216" height="72" />
            </font></td>
        <td width="214"><div align="center" class="title2"></div></td>
        <td width="209">&nbsp;</td>
      </tr>
 </table>

Of course if I comment out the Response.ContentType and view in the browser works great.  When I un-comment Response.ContentType - no logo shows up.

Any ideas?

JS
ASKER CERTIFIED SOLUTION
Avatar of Ashutosh Vyas
Ashutosh Vyas
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JS List

ASKER

Good references.  Eventually I figured out I was trying to pull the image from an area where Active directory is used.  When switched to general area the images displayed.