open word doc from the server on the cients pc

T

ton

Hi,

I'm creating an application and I want to give users access to saved Word
documents on the server. How can I establish this.

I prefer to open specific Word documents directly into word on the client
but if it is in a (different) browser it is ok.

I've tried:
<A HREF="Websitefolder/systeemAT.doc">systeemAT.doc</A>

but I received an error:

Server Error in '/WebSite2' Application.
--------------------------------------------------------------------------------

HTTP Error 403 - Forbidden
Version Information: ASP.NET Development Server 8.0.0.0

I prefer to give acces to a folder on a different disk on the server

thanx

Ton
 
A

Anthony Jones

ton said:
Hi,

I'm creating an application and I want to give users access to saved Word
documents on the server. How can I establish this.

I prefer to open specific Word documents directly into word on the client
but if it is in a (different) browser it is ok.

I've tried:
<A HREF="Websitefolder/systeemAT.doc">systeemAT.doc</A>

but I received an error:

Server Error in '/WebSite2' Application.
-------------------------------------------------------------------------- ------

HTTP Error 403 - Forbidden
Version Information: ASP.NET Development Server 8.0.0.0

I prefer to give acces to a folder on a different disk on the server


Unless you are testing ASP.NET related code its not a good idea to test
things using the development server.

Try this using IIS and see what happens.
 
F

Frederik Van Lierde

Try the following idea:

1. Read the file and get is into a Byte[]
2. PLay with the context object

!!! Set the ContentType to "application.msword" for Word Documents,
see the internet for other applications

An example. Is used this example on http://www.getMyVCard.com,
ofcourse I changed the ContentType :)


Byte[] byteArray = the file readed;

Context.Response.Clear();
Context.Response.ContentType = "application/msword";
Context.Response.AddHeader("Content-Disposition", " filename=" +
"filename.doc");
Context.Response.AddHeader("Content-Length",
byteArray.Length.ToString());
Context.Response.BinaryWrite(byteArray);
Context.Response.Flush();


I hope this bring you into the good direction

Frederik Van Lierde
http://www.SilverSandsAssociates.com
http://BlueBizTalk.blogspot.com
 
A

Anthony Jones

Frederik Van Lierde said:
Try the following idea:

1. Read the file and get is into a Byte[]
2. PLay with the context object

!!! Set the ContentType to "application.msword" for Word Documents,
see the internet for other applications

An example. Is used this example on http://www.getMyVCard.com,
ofcourse I changed the ContentType :)


Byte[] byteArray = the file readed;

Context.Response.Clear();
Context.Response.ContentType = "application/msword";
Context.Response.AddHeader("Content-Disposition", " filename=" +
"filename.doc");
Context.Response.AddHeader("Content-Length",
byteArray.Length.ToString());
Context.Response.BinaryWrite(byteArray);
Context.Response.Flush();


I hope this bring you into the good direction

Not really. If you've got static content sitting in your site its
preferable to have IIS static content handler deliver it.

If the word document is 40MBs how much memory is needed for the code above?
If the user revisits the document do they get a cached version or does the
server have to do all that again?

BTW, what purpose does the Flush serve? What would happen if it were not
there?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top