Thanks Eric Pascarello and Bear Bibeault
For your instant reply and guiding me.... I have found the resolution to get the file name through the Javascript, its the following code...
<%@page import=" javax.servlet.ServletRequest" %>
<html>
<head>
<title>JSP Page</title>
<script type="text/javascript">
function ViewImage(filename)
{
var imageview = document.getElementById('ImageView');
imageview.innerHTML += '
' +filename.value+'
';
}
</script>
</head>
<body>
<h1>Hello World!</h1>
<div id="ImageView"></div>
File needed to upload
<input type="File" name="Browse" id="browse" onchange="ViewImage(this);" >
</body>
</html>
But Now i have one more problem... i want to write a javascript in a way that i can view the
word document and pdf document on same webpage.... So please guide me ahead or suggest me what need to do ahead...?
i am using following code but its opening in microsoft word and also not displaying me the document.
<script type="text/javascript">
function ViewImage(filename)
{
var imageview = document.getElementById('ImageView');
imageview.innerHTML += '
' +filename.value+'
';
openWordDocPath(filename);
}
function openWordDocPath(strLocation)
{
var objWord;
var imageview = document.getElementById('ImageView');
imageview.innerHTML += '
' +strLocation+'
';
objWord = new ActiveXObject("Word.Application");
objWord.Visible = true;
var imageview = document.getElementById('ImageView');
imageview.innerHTML += '
' +strLocation+'
';
objWord.Documents.Open(strLocation);
}
</script>
please help me...
thanks