HTMLFormat and images


In my web site, I'm converting a document with an image to HTML format to display on a web page. During the conversion, the image is getting created correctly in the TEMP folder and displays correctly on the page as long as I'm running inside the Visual Studio 2005 debugger.

If I try to access the web site directly from a standard browser (IE, FireFox,...), not through VS2005 debugger, the image does not display on my web page. The image is getting created and it appears to have a valid reference after reviewing the HTML source file.

I'm sure this is somehow related to security (user or directory) but for the life of me can't figure out how to resolve the problem.

Any help with this dilemma would be greatly appreciated.


Please check if your web site host ASPNET account has enough rights to access the generated image.


I'm using Aspose.Words Document constructor to load the doc file and then using the document.Save method to convert to FormatHtml. If the doc file contains an image, the image is created in the TEMP folder and the html source contains a reference to the physical location.

Is there a way to specify where (i.e physical or virtual path) the images are to be created/referenced?


If you save the document in HTML format to a stream, you can control the directory to save images using the Document.SaveOptions.ExportImagesFolder property (also consider the Document.SaveOptions.HtmlExportImagesFolderAlias property). If you save the document to a file, Aspose.Words writes the embedded images into the same directory where the file is saved.


Usinng the ExportImagesFolder resolves the security issues with the TEMP folder… Thank you very much.