none
How to open .MHT files directly in browser from SharePoint 2013 RRS feed

  • Question

  • Hi,

    I have some .mht files stored in a document library on a SharePoint 2013 farm. When I open them from the SharePoint portal, they open using Word. I'd like to open them directly in browser. I have already tried out below:

    1. Settings on the web application (Settings-> Site Settings->Site Collection Administration-> Site Collection Features) are configured for opening directly in browser.

    2. Added 'application/mht' and 'application/mhtml' as trusted MIME types to the web application as mentioned over here.

    3. Removed "ms-word" from OpenApp attribute for "mht" and "mhtml" Keys from DOCICON.xml file. 

    4. I do not want to set the Browser file handling option to Permissive.

    I can open .pdf files, directly in browser, from the same SharePoint web application, using WordPdf app. For .pdf files, I had to install February/March update for SharePoint 2013.

    Please let me know if you have any ideas to resolve this problem with directly opening .mht files in browser.

    -Thanks,

    Gaurav




    Monday, July 22, 2013 8:41 AM

Answers

  • Hi Malhotra,

    As a workaround, you can right-click the mht file link from library and click "Open in new tab"(or click the mouse middle-button/wheel to open the mht file in new tab) in IE browser, it will be opened and displayed in browser new tab directly.

    Thanks


    Daniel Yang
    TechNet Community Support

    Wednesday, July 24, 2013 8:51 AM
    Moderator

All replies

  • Hi Malhotra,

    As a workaround, you can right-click the mht file link from library and click "Open in new tab"(or click the mouse middle-button/wheel to open the mht file in new tab) in IE browser, it will be opened and displayed in browser new tab directly.

    Thanks


    Daniel Yang
    TechNet Community Support

    Wednesday, July 24, 2013 8:51 AM
    Moderator
  • Hello,

    It works at my local for .mht and .mhtml.

    $webapp = Get-SPWebApplication -Identity "webapplicationurl"
    $webapp.AllowedInlineDownloadedMimeTypes.Add("message/rfc822")
    $webapp.Update()

    Thanks

    • Proposed as answer by K Rock Wednesday, February 24, 2016 1:46 PM
    Sunday, September 22, 2013 3:24 PM
  • Hello,

    It works at my local for .mht and .mhtml.

    $webapp = Get-SPWebApplication -Identity "webapplicationurl"
    $webapp.AllowedInlineDownloadedMimeTypes.Add("message/rfc822")
    $webapp.Update()

    Thanks


    This is the solution!!!
    Wednesday, February 24, 2016 1:46 PM
  • Hello,

    It works at my local for .mht and .mhtml.

    $webapp = Get-SPWebApplication -Identity "webapplicationurl"
    $webapp.AllowedInlineDownloadedMimeTypes.Add("message/rfc822")
    $webapp.Update()

    Thanks


    This is the solution!!!

    I tested it and it worked, but I don't want to deploy it in PROD until someone can, if possible, explain me what is it doing.

    I learned that the AllowedInlineDownloadedMimeTypes allows to open the files instead of downloading them, but I just want to know the implications of the message/rfc822. Is it only going to allow the file types MHT to be open via browser, or other file types will be allowed as well? Please let me know if anyone can help me understand this.

    Monday, August 7, 2017 7:32 PM