How to open a docx file from an asp.net application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gwen.demby@gmail.com

    How to open a docx file from an asp.net application

    Hello, I hope all is well.. I was wondered if someone had a fix for
    opening docx file... I am currently using the response.redire ct("path
    of word document") however it does not work while trying to open docx
    files.. I recieve an "HTTP Error 404 - File or directory not found.
    Internet Information Services (IIS)" error...
    thanks for your help.
  • Ben Schwehn

    #2
    Re: How to open a docx file from an asp.net application

    On Thu, 31 Jul 2008 05:22:52 -0700, gwen.demby wrote:
    Hello, I hope all is well.. I was wondered if someone had a fix for
    opening docx file... I am currently using the response.redire ct("path of
    word document") however it does not work while trying to open docx
    files.. I recieve an "HTTP Error 404 - File or directory not found.
    Internet Information Services (IIS)" error... thanks for your help.

    Is the "path of word document" a relative path in your virtual directory?
    Then Perhaps your iis isn't configured to serve docx files, you can change
    that in the iis administration under mime types.

    If you're using the filesystem path (like response.redire ct(@"c:
    \foo.docx")), this doesn't work, instead you could in your asp page open
    the file using the System.IO classes and stream it directly into the
    Respone.OutputS tream.


    --
    Ben | bschwehn.de

    Comment

    • Chris Simon

      #3
      How to open a docx file from an asp.net application -gwen.demb

      You need to add the mime type to IIS

      docx is: application/vnd.openxmlform ats-officedocument. wordprocessingm l.document

      Comment

      Working...