open word doc from the server on the cients pc

  • Thread starter Thread starter ton
  • Start date Start date
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
 
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.
 
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
 
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?
 
Back
Top