locked
MIME Types - Download .msg files RRS feed

  • Question

  • User-1821287852 posted

    Hi, 

    I have developed an asp.net mvc web application and publish it to azure. The application allows users to upload files to the application that are kept in specific server directories, that they can open at any time. 

    Nevertheless, when users attach .msg files (saved emails from Outlook) and try to open them they get an "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." error. 

    I've tried to change the mime type in my web.config file like this:

    <system.webServer>   
        <staticContent>
          <mimeMap fileExtension=".msg" mimeType="application/octet-stream" />
        </staticContent>
    </system.webServer>

    but the problem persists. When I run the web application in my local development environment I get the same error.

    Can anyone help me on this.

    Thanks

    Bruno

    Tuesday, November 6, 2018 9:25 AM

Answers

  • User61956409 posted

    Hi Bruno,

    You can try:

    <staticContent>
      <remove fileExtension=".msg"/>
      <mimeMap fileExtension=".msg" mimeType="application/vnd.ms-outlook" />
    </staticContent>

    Test Result:

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 7, 2018 2:35 AM

All replies

  • User-1509636757 posted

    I suspect it has something to do with routing in your application. I suggest you refer to RouteConfig.cs file.

    Here are some related links, if you find them useful:

    Tuesday, November 6, 2018 10:35 AM
  • User753101303 posted

    Hi,

    This is ASP.NET 4.x with MVC 5 ? Beyond the mime type config, I see storing files in a special directory such as App_Data or configuring ASP.NET so that physical files are processed as well with the routing system (RouteExistingFiles=true).

    What if you try a .htm file in the same directory ? If it still doesn't work why if you try an .htm file in another directory?

    Tuesday, November 6, 2018 12:01 PM
  • User61956409 posted

    Hi Bruno,

    You can try:

    <staticContent>
      <remove fileExtension=".msg"/>
      <mimeMap fileExtension=".msg" mimeType="application/vnd.ms-outlook" />
    </staticContent>

    Test Result:

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 7, 2018 2:35 AM