Saving URLs to MHTML via .NET

I just posted another CodeProject article, Convert any URL to a MHTML archive using native .NET code. The title is a bit misleading; using my class, you can actually convert any URL to one of four formats in a single line of code:

  • Web Page, complete (HTML plus files in subfolder)
  • Web Archive, single file (MHTML only)
  • Web Page, HTML only (HTML only)
  • Text File (TXT only)

This mimics the ‘File | Save As’ menu in Internet Explorer as closely as I could get it to. It’s pretty darn close, and quite handy. We are using IE as a basic reporting engine, and it’s a lot easier to email someone a report – or store it in a document management system – when you have a single MHTML file!

I knew IE had some crazy way of saving a complete web page as a single file, but I was as surprised as anyone else to find that IE’s “Web Archive” save option is based on an actual internet standard: RFC standard 2557, compliant Multipart MIME Message (MHTML web archive). As I mentioned a few months ago in my post about Visual Diff Tools, this should work in Firefox, too...

Read more

Stay Gold, America

We are at an unprecedented point in American history, and I'm concerned we may lose sight of the American Dream.

By Jeff Atwood · · Comments

The Great Filter Comes For Us All

With a 13 billion year head start on evolution, why haven't any other forms of life in the universe contacted us by now? (Arrival is a fantastic movie. Watch it, but don't stop there - read the Story of Your Life novella it was based on

By Jeff Atwood · · Comments

I Fight For The Users

If you haven't been able to keep up with my blistering pace of one blog post per year, I don't blame you. There's a lot going on right now. It's a busy time. But let's pause and take a moment

By Jeff Atwood · · Comments

The 2030 Self-Driving Car Bet

It's my honor to announce that John Carmack and I have initiated a friendly bet of $10,000* to the 501(c)(3) charity of the winner’s choice: By January 1st, 2030, completely autonomous self-driving cars meeting SAE J3016 level 5 will be commercially available for passenger

By Jeff Atwood · · Comments