Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Opening word documents stored in SQL Server using ASP.Net

Reply
Thread Tools

Opening word documents stored in SQL Server using ASP.Net

 
 
=?Utf-8?B?cmljaGk=?=
Guest
Posts: n/a
 
      11-17-2004
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBNVlA=?=
Guest
Posts: n/a
 
      11-17-2004
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

 
Reply With Quote
 
 
 
 
Eliahu
Guest
Posts: n/a
 
      11-17-2004
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" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...
>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



 
Reply With Quote
 
=?Utf-8?B?cmljaGk=?=
Guest
Posts: n/a
 
      11-18-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading SQL Server varbinary (word, excel, pdf...) documents in browser desaitapan1 ASP .Net 0 12-29-2010 03:39 PM
Opening Word Documents dew ASP .Net 0 02-07-2006 05:10 PM
Retrieving word docs stored in sql server? =?Utf-8?B?RGF2ZQ==?= ASP .Net 1 01-16-2006 01:27 AM
Word file not opening from Adm -My recent docs but opening from file menu of Word Thaqalain Computer Support 0 06-30-2005 02:20 AM
opening and saving word documents in asp.net =?Utf-8?B?TWFyaw==?= ASP .Net 4 08-20-2004 03:33 PM



Advertisments