• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

img tag in jsp

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
iam trying to display an image from the local system on the browser using image tag, in my jsp file. But the image is not displayed. i am using netbeans6.0 IDE and tomcat 6.0.14 for development.

below is the code . it is a simple html code. iam unable to trace the error.
anuone please help me out of this.

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function getimgsize()
{
var path=document.getElementById('f1').value;
alert(path);
document.write("<img src='"+path+"'>")
}
</script>

</head>
<body>
<img src="D://jagdish//images//five.jpg" alt="image cannot be displayed"/>
<form method="post" action="" onsubmit="getimgsize()">
<input type="file" name="file1" id="f1">
<input type="submit">
</form>
</body>
</html>


Thanks in advance,
jagdish
 
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You do realize that this will work only when the browser is being displayed on the system housing the image file and will not work on any other system, right?

In any case, what's with the double-slashes?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic