473,789 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

open word doc from the server on the cients pc

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="Websitefo lder/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

Aug 22 '08 #1
4 1679
"ton" <to*@nospam.nlw rote in message
news:a9******** *************** ***@cache3.tilb u1.nb.home.nl.. .
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="Websitefo lder/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.

--
Anthony Jones - MVP ASP/ASP.NET
Aug 22 '08 #2
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.ms word" 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.Respons e.Clear();
Context.Respons e.ContentType = "applicatio n/msword";
Context.Respons e.AddHeader("Co ntent-Disposition", " filename=" +
"filename.doc") ;
Context.Respons e.AddHeader("Co ntent-Length",
byteArray.Lengt h.ToString());
Context.Respons e.BinaryWrite(b yteArray);
Context.Respons e.Flush();
I hope this bring you into the good direction

Frederik Van Lierde
http://www.SilverSandsAssociates.com
http://BlueBizTalk.blogspot.com
Aug 22 '08 #3
"Frederik Van Lierde" <fr******@blueo ceansgroup.comw rote in message
news:df******** *************** ***********@y21 g2000hsf.google groups.com...
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.ms word" 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.Respons e.Clear();
Context.Respons e.ContentType = "applicatio n/msword";
Context.Respons e.AddHeader("Co ntent-Disposition", " filename=" +
"filename.doc") ;
Context.Respons e.AddHeader("Co ntent-Length",
byteArray.Lengt h.ToString());
Context.Respons e.BinaryWrite(b yteArray);
Context.Respons e.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?

--
Anthony Jones - MVP ASP/ASP.NET
Aug 22 '08 #4
"Anthony Jones" <An*@yadayadaya da.comwrote in message
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
>Context.Respon se.Flush();

BTW, what purpose does the Flush serve?
None, since it's the last line of the routne anyway.
What would happen if it were not there?
Nothing different.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 22 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2917
by: Jason Huang | last post by:
Hi, Using C# web form in ASP.Net, how to open a MS Word application? Thanks for help. Jason
2
4737
by: Todd | last post by:
Ok, this code works fine on the Web server machine. But when I try to run it via any other clients on the LAN, I keep getting scripting errors (the MS Word Document never opens.) Do I have to configure the server somehow to allow it to share this MS Word doc? <SCRIPT LANGUAGE=VBScript> Dim objWord Sub Btn1_onclick() call OpenDoc("http://WEBSERVER/ClerkOfCourt/CourtLetters/TestTemplate.doc")
3
6345
by: grzybek | last post by:
Hi, I upload files to ma Web Server and then I can view those files as link. I'd like to be able to open those file in proper application on client PC. I want achieve the same result as though these files were saved locally on the client disk. For example .exe files - open window ( open , save or cancel possibility ) or for .doc files to open in Word application or save on disk.
1
4359
by: Andrew | last post by:
I'm adding this as it to me a while to figure out all the pieces to be able to do this without using Microsoft.Office.Interop which caused me problems on the web-server. Streaming is the easy part, but I couldn't initially work out how to manipulate the page setup to change page margins and orientation, that's why I was looking at Microsoft.Office.Interop. But with Microsoft.Office.Interop I couldn't fiure out how to stream HTML...
0
2413
by: senthilavs | last post by:
Hi, Im having word document in the Server Machine. While im trying to open the file in Client Machine file is opening in Server only. I need to open in the client only. This is an ASP.NET project done in VB.NET. The Code i used to Open the file --------------------------------------------- Dim oWordApplic As New Word.ApplicationClass Dim oDoc As Word.Document Dim strFileName As String =...
0
3232
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want to register new customer or companies they will enter the information in Windows Form and the program automaticaly creates the WORD document under specific folder under application path. Once the empty word file created than ask user if they want...
7
4019
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
2
4435
by: saketmayur | last post by:
Hi , I have write the following code to open word document on server using Microsoft.Office.Interop.Word; string DocPath = System.Configuration.ConfigurationManager.AppSettings; ApplicationClass wordApp = new ApplicationClass(); string filePath = ""; filePath = DocPath + Session + "/" + DocFile.Value.ToString();
0
9499
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10124
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8998
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5405
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4078
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.