Re: How to get image file from .mht file and save it as a image fi

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>>
>>
>>


.



Relevant Pages

  • Re: good email parser ??
    ... parse multipart and mime and base64, with all the varieties of email ... to find a email which can't parse. ... tried the below code and figured the skeleton would report the base64 ... image attachments in a MIME message, ...
    (comp.lang.perl.misc)
  • Re: good email parser ??
    ... parse multipart and mime and base64, with all the varieties of email ... to find a email which can't parse. ... tried the below code and figured the skeleton would report the base64 ... image attachments in a MIME message, ...
    (comp.lang.perl.misc)
  • Re: good email parser ??
    ... to find a email which can't parse. ... tried the below code and figured the skeleton would report the base64 ... image attachments in a MIME message, ... Perl will just convert it internally to a numeric, or in this case, a string representation of "false", 0 or '' respectively. ...
    (comp.lang.perl.misc)
  • Re: tcllib mime package: reading from stdin
    ... >> AFAIK you have to read the complete message from stdin before the mime ... >> package is able to parse it. ...
    (comp.lang.tcl)
  • Re: parse mime
    ... Erik Rosenbach wrote: ... > I have a question about how to parse out mime from a message. ... Edwin Martin. ...
    (comp.lang.java)