presenting MHT files in the browser

  • Thread starter Thread starter David Travis
  • Start date Start date
D

David Travis

Hello all,

I am trying to present my users MHT files, which are stored in a database.

For example, the following demo link should present an MHT which is stored
in the database with ID of 92:
"http://www.XXX.com/FileFetcher.aspx?id=92"

For some reason the browser (ie6) prepends "mhtml:" prefix to the address:
"mhtml:http://www.XXX.com/FileFetcher.aspx?id=92"

This causes the browser to show a 404 error.

My link does NOT contain this prefix at all(!)

2 more interesting facts:

1) If I store an MHT file in the site (not in the database, but as another
file in the site), the browser does not prepend anything, and the page is
displayed properly.

2) The FileFetcher.aspx worked fine before I installed a windows update
patch: "330994: April 2003, Security Update for Outlook Express 6 SP1". This
update deals with MHT issues, but there is nothing in it's documentation
about my problem.


Please send anything comes in your mind... You guys are my last resort.


Thanks,
David.
 
I did solve the problem, but it is mighty convoluted.

Turns out the problem goes away with IE on XP SP2, but I had to support
earlier versions of IE too.

Earlier browsers are fine if the extension of the URL is .MHT, so
that's what I did. Then I created and installed a custom IHttpHandler
for MHT (see http://support.microsoft.com/kb/308001/EN-US/) so I could
return what I wanted.

I found a slight problem, which I overcame. In certain cases, if the
url ends .mht but also has a query string, i.e. .../default.mht?id=92,
it would revert to the old problem. What I did was embedded the id in
the actual url, i.e. .../default92.mht
 
Back
Top