Image file cannot be written to disk when using link images when saving document as Html

I have a .docx template and have defined some mailmerge fields and included an image from the web as link included. When I’m trying to save the document as output for HTML i’m getting the following error:

Image file cannot be written to disk. When saving the document to a stream either ImagesFolder should be specified or custom streams should be provided via ImageSavingCallback.
This is a bit of strange behaviour when using a link to an image which resides on the web because it should not have to save it to disk ? Why must the image be saved to disk when in the .docx template the image linked to a http address because you can use as SRC in the IMG tag this address when converting to HTML ?

Is there any solution for this problem to use it without saving these images to disk when using images on the web ?

Hello
Thanks for your request. It is expected behavior, because when you insert an image to the document this image will be embedded to the document, even if it is specified as external link.
When you save a Document in HTML format, Aspose.Words needs to save all images embedded in the document as standalone files. ImagesFolder allows you to specify where the images will be saved and ImagesFolderAlias allows to specify how the image URIs will be constructed.
https://reference.aspose.com/words/net/aspose.words.saving/htmlsaveoptions/imagesfolder/
Best regards,

I disagree of your assumption because it is possible to use an external link after my collegau pointed to insert the image as link.

When inserting external images you have three options to insert the image:

  1. Insert
  2. Link to file
  3. Insert and link

If you select Insert (default) the image will be embedded in the document. When you select for Insert and link the image will also be embedded and linked to the external address. But when you select Link to file the image will not be embedded but will directly linked to the external address.

So if you want to use external images you must select this option and the document will be saved as HTML without any problem and will be external linked to the image instead of saving to the disk.

Hello
Thank you for additional information. Could you please attach your input document here for testing? I will check it on my side and provide you more information.
Best regards,