473,385 Members | 2,044 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,385 software developers and data experts.

How display a word file content in internet explorer using java

hi alll..

i wanna display a word file content in a browser..how can i do that..i hav done one coding in that i can display the contents...but with contents some symbols also coming...
anyone pls help me
my code...
<%@ page import="java.io.*,javax.servlet.http.HttpServletRe quest,javax.servlet.ServletInputStream" %>
<%@ page import="java.io.FileWriter,java.io.IOException" %>
<html>
<head>
<title>
</title>
</head>
<body>
<%
try
{
String contentType = request.getContentType();
%>
Content Type:<%out.println("Content type is :: " +contentType);%><br>
<%
int len;
if ((contentType != null)&&(contentType.indexOf("multipart/form-data") >= 0))
{
DataInputStream in = new DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < formDataLength)
{
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
}
String file = new String(dataBytes);
InputStream is=new FileInputStream(file);

is.close();

}
}
catch(Exception e)
{
out.println(e);
}
%>
</body>
</html>

wtz wrong in that???? help me..
neha..
May 16 '07 #1
0 1645

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

Similar topics

2
by: Frostillicus | last post by:
I'm trying to get an ASP to return a zip file to the remote browser from an Image (BLOB) field in SQL Server 2000 but Internet Explorer keeps saying: Cannot open C:\Documents and...
2
by: Erik Ronne | last post by:
Hello Gurus I have an intranet web page with links to all kinds of Microsoft Word document that we use at my work, so my co-works can go to the web page when they need a special document....
7
by: Winston | last post by:
Hi, I want to use the Webbrowser Control (the Internet Explorer Control) to display an XML-structure within a C# WinForm. The way the IE displays a XML-file in its native form is exactly what I...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
7
by: TLM | last post by:
I am trying to build a web application that will contain links to files on a users local computer. I am assuming that the files will be in a known location and can display in a browser window. ...
10
by: Åženol Akbulak | last post by:
Hi, I have a form page to print on my web application(asp.net). I want to show the page in WORD. I use that code in asp.net Page_Load event: Response.Clear(); Response.ContentType =...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
5
by: Anders K. Olsen | last post by:
Hello group I'm developing a file application, but I have run into a problem that I hope you can help with. My application lists a number of files (names). Now I would like to display the...
1
by: dearprasan | last post by:
I have a custom browser application built in C#. I want to access the Internet Explorer's Cache to display contents on this custom browser application. For example: If the user types "www.msn.com"...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.