Hello,
I have an mhtml file that I tried to load using aspose words and it throws the following error:
The document appears to be corrupted and cannot be loaded. Unexpected format of MIME heading. Special chars in parameter name.
Here is sample code and attached are sample files:
public void Test()
{
try
{
var good = @"d:\input\good.MHTML";
var bad = @"d:\input\bad.MHTML";
var d1 = new Aspose.Words.Document(good);
var d2 = new Aspose.Words.Document(bad); // throws an exception : The document appears to be corrupted and cannot be loaded. Unexpected format of MIME heading. Special chars in parameter name.
}
catch(Exception ex)
{
Console.WriteLine(ex);
}
}
I modified the file that was not working and named it good, if you compare the two file you will see that top multi-part section is removed and content-transfer-encoding is changed from binary to 7bit, these changes fix the issue.
I am able to open the mhtml file in both MS word and internet explorer without issue is it a bug in the aspose code?
Thanks
Ed
Data.zip (3.7 KB)