Opening word documents stored in SQL Server using ASP.Net

Discussion in 'ASP .Net' started by =?Utf-8?B?cmljaGk=?=, Nov 17, 2004.

  1. Hello, i'm hoping that somebody can point me in the right direction with my
    problem.

    I have been tasked with creating a simple browser based application that
    will allow the user to upload Word documents to SQL Server and then retrieve
    them when needed. Storing the Word document seems to be no problem but where
    I am stuck is on retrieving them and then displaying the Word documents as
    through ASP.NET it will be on the server i think.

    Does anybody know of any articles, best practices or advice that will allow
    me to crack this problem.

    Many thanks for your guidance in advance.

    R
     
    =?Utf-8?B?cmljaGk=?=, Nov 17, 2004
    #1
    1. Advertising

  2. I am sure there are some articles. The basic of outputting as a different
    type is changing the mime type of the response. To get the document out, you
    will stream directly to HTTP, as it is the most efficient. What this means is
    the display page is an ASPX without any ASPX tags (just the @ directive) and
    you will be manipulating the type in the response header in your CodeBehind.

    In addition, you may have to set up IIS to recognize Word as a valid MIME
    type.

    ---

    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************

    "richi" wrote:

    > Hello, i'm hoping that somebody can point me in the right direction with my
    > problem.
    >
    > I have been tasked with creating a simple browser based application that
    > will allow the user to upload Word documents to SQL Server and then retrieve
    > them when needed. Storing the Word document seems to be no problem but where
    > I am stuck is on retrieving them and then displaying the Word documents as
    > through ASP.NET it will be on the server i think.
    >
    > Does anybody know of any articles, best practices or advice that will allow
    > me to crack this problem.
    >
    > Many thanks for your guidance in advance.
    >
    > R
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Nov 17, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?cmljaGk=?=

    Eliahu Guest

    On your aspx page that's supposed to show the word document write:

    <%@ Page language="c#" Codebehind="ExportToWord.aspx.cs"
    AutoEventWireup="false" Inherits="WebTry001.Graph.ExportToWord" %>
    <% RenderWordData (); %>

    and on the code-behind write:

    protected void RenderExcelData ()
    {
    Response.ContentType = "application/ms-word";
    Response.AddHeader("Content-Disposition",
    "inline;filename=MyReport.doc");

    //here save the content of your document to Response.OutputStream ...

    }

    hope it helps.


    "Cowboy (Gregory A. Beamer) - MVP" <> wrote
    in message news:...
    >I am sure there are some articles. The basic of outputting as a different
    > type is changing the mime type of the response. To get the document out,
    > you
    > will stream directly to HTTP, as it is the most efficient. What this means
    > is
    > the display page is an ASPX without any ASPX tags (just the @ directive)
    > and
    > you will be manipulating the type in the response header in your
    > CodeBehind.
    >
    > In addition, you may have to set up IIS to recognize Word as a valid MIME
    > type.
    >
    > ---
    >
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > ***************************
    > Think Outside the Box!
    > ***************************
    >
    > "richi" wrote:
    >
    >> Hello, i'm hoping that somebody can point me in the right direction with
    >> my
    >> problem.
    >>
    >> I have been tasked with creating a simple browser based application that
    >> will allow the user to upload Word documents to SQL Server and then
    >> retrieve
    >> them when needed. Storing the Word document seems to be no problem but
    >> where
    >> I am stuck is on retrieving them and then displaying the Word documents
    >> as
    >> through ASP.NET it will be on the server i think.
    >>
    >> Does anybody know of any articles, best practices or advice that will
    >> allow
    >> me to crack this problem.
    >>
    >> Many thanks for your guidance in advance.
    >>
    >> R
     
    Eliahu, Nov 17, 2004
    #3
  4. Many thanks for your help.

    If anybody knows of any documents or sample applications to look at I would
    be gratefull if you could provide the URL.

    Thanks

    R
     
    =?Utf-8?B?cmljaGk=?=, Nov 18, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWFyaw==?=

    opening and saving word documents in asp.net

    =?Utf-8?B?TWFyaw==?=, Aug 20, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    578
    =?Utf-8?B?TWFyaw==?=
    Aug 20, 2004
  2. =?Utf-8?B?RGF2ZQ==?=

    Retrieving word docs stored in sql server?

    =?Utf-8?B?RGF2ZQ==?=, Jan 15, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    414
    =?Utf-8?B?RWx0b24gVw==?=
    Jan 16, 2006
  3. dew

    Opening Word Documents

    dew, Feb 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    502
  4. desaitapan1
    Replies:
    0
    Views:
    2,093
    desaitapan1
    Dec 29, 2010
  5. Tony
    Replies:
    2
    Views:
    390
Loading...

Share This Page