473,412 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Opening a word document on server in client browser

Here's the problem:

- Website is ASP.NET 1.0
- Server is Windows Server 2003
- Browser is IE 6/7
- Client requests a mail merged MS Word 97 - 2003 document on the website, and the document gets created on the server.
- Need to send the document to the client browser and delete the file from the server.

Previously, the web application already did this, but after some hardware and location changes, the application no longer performs this functionality. The file still successfully gets created, but for some reason, the file does not get opened client-side.

Here is the current code:
Expand|Select|Wrap|Line Numbers
  1. Response.Write("<script>")
  2. Response.Write("var wordWin = window.open(""" http://www.domain_here.org/WebApp/WordFolder/" & strFileNm & """, ""wordWin"", ""width=800,height=600,menubar=1,resizable=1,scrollbars=yes,status=yes"");")
  3. Response.Write("</script>")
  4. Response.Write("<script>window.location.href = window.location.href;</script>")
strFileNm is the name of the file that was created.

Some additional information... Leaving Response.Write("<script>window.location.href = window.location.href;</script>") causes the client browser to open another window for a brief moment, but no option to open a word document appears, and the file disappears from the server directory. Commenting out that same line of code keeps the file on the server and no window is opened client side. I'm sort of confused about what this line actually does.

One last oddity, the file gets opened when I debug the application on a dev machine, but not when I deploy the application to their live system. I suspect there are permission issues with a remote user accessing a file stored on the server, but I'm not sure how to correct this problem...

Please please please provide me with some assistance. Been troubleshooting this for many hours :)
Mar 31 '08 #1
1 2156
balabaster
797 Expert 512MB
I might be tempted to do this slightly differently. In the server side code after the file has been built - do:

Expand|Select|Wrap|Line Numbers
  1. Response.Redirect("http://www.domain_here.org/WebApp/WordFolder/" & strFileNm);
It makes a lot more sense than doing the whole client side opening a new window etc. - a lot simpler. The response.redirect should ask them if they want to open the file or save it.
Mar 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
3
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
2
by: Parag Joshi | last post by:
Hi, I have a peculiar problem. Hope some body can help. I want to open up a word document on the client from a ASPX page. When a user clicks a button I want to show him a word document whose...
2
by: KnotKnormal | last post by:
I would like to dynamically load a HTML page (or a Word document), which is embedded in a table when the user clicks on a hyperlink to go from HTML page one to HTML page two. For example, I would...
4
by: Thomas Scheiderich | last post by:
I can't seem to open a word document from any of my browsers except the one on my web server. Here is the .aspx file: ***************************************************************** <%@...
1
by: ourspt | last post by:
Hi, We are working on an ASP.NET (VB.NET) application and we have a problem opening a word document from our application. When we try to open the word document, we do not get any error...
4
by: enak | last post by:
I need to open a Word template so that I can merge some data from a database with the document. I am using ASP.NET, VB.NET. I can not even get MS Word to be visible. I can see that an instance is...
7
by: mkorch17 | last post by:
Hello, I have a server with a Word document and an Access database on it. I also have an ASP page running on the server. The Word document contains a mail merge with the Access database. What...
5
by: Cedric | last post by:
Hi Folks, I'm wondering if someone has already succeed to open a word2000 document located on server side with javascript code executed by a web browser on client side. In fact, i make it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.