Florent V Florent V -4 years ago 87
ASP.NET (C#) Question

ASP window.open file ODT

I have some problems with a function window.open('url').
My variable "url" focus on a ODT file and when i try to open this file with a web browser (http://localhost//../test.odt), I have "HTTP 404 PAGE NOT FOUND".

I have already tried with diferent extentions : png, pdf, docx, etc. and it's work.

For information : the file is uploaded on a local repertory.Is the problem could be the MIME content or something else ?

Thanks you

Answer Source

Your website in IIS don't have configured MIME type for .odt files. Correct mimetype is:

application/vnd.oasis.opendocument.text 

In your web.config file you need to add inside system.webServer section:

<staticContent>
    <remove fileExtension=".odt" />
    <mimeMap fileExtension=".odt" mimeType="application/vnd.oasis.opendocument.text" />
</staticContent>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download