Re: How to get image file from .mht file and save it as a image fi
- From: "He Shiming" <mailbill(NOSPAM)@21cn.com.nospam>
- Date: Fri, 20 May 2005 23:42:28 +0800
Try this URL: http://www.adp-gmbh.ch/cpp/common/base64.html for explanations
on base64 encoding and decoding.
Although you'll have to parse the .mht files yourself. You can parse it line
by line and try to catch the attachment boundaries. Google "MIME" and
"Base64" for more information.
In fact, when you navigate to an .mht file, Internet Explorer parse the file
and extract those files into the temporary directory to display.
Hope this helps,
--
He Shiming
"david" <david@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:26A7288C-2F33-400A-974D-B909BAE06BE2@xxxxxxxxxxxxxxxx
> Thank you very much for the answer.
> Would you please show me an example code about it?
>
> Thanks in advance,
> David
>
> "He Shiming"?? ??? ??:
>
>> Well, I'm not sure that the webbrowser control can do it programatically.
>> The IHTMLImgElement doesn't provide a save as method.
>>
>> However, it's really easy to parse .mht files without the WB ctrl. The
>> .mht
>> files are actually regular email files. If it contains an image, the
>> whole
>> message is usually encoded in MIME 1.0 and the image is encoded in
>> base64.
>> It's a pure text file encoded in 7-bit ASCII. So you can read them line
>> by
>> line, and perform a base64 conversion when an image is found.
>>
>> --
>> He Shiming
>>
>> "david" <david@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:C5A0259D-D00F-408E-BB76-CC1EFF723577@xxxxxxxxxxxxxxxx
>> > Hi all,
>> > I have .mht files and I load it using WebBrowser control to get
>> > IHTMLDocument2. It's easy to get html data from IHTMLDocument2, but I
>> > coudn't
>> > get image data and save it to a file. I want to get image data embedded
>> > from
>> > .mht file and save it to a file. How to save image file from .mht file.
>> > Any
>> > ideas?
>> >
>> > Thanks in advance,
>> >
>> > david
>>
>>
>>
.
- References:
- Prev by Date: Help:IWebBrowser2 / DISPID_NEWWINDOW2 /Child window hangs
- Next by Date: How to: Load HTML images from database?
- Previous by thread: Re: How to get image file from .mht file and save it as a image fi
- Next by thread: Meta Refresh not functioning in IE6
- Index(es):
Relevant Pages
|