1

I am having few jpeg images on "C:/images/". I would like to slide show these images on a web page.I am using java code to get the right path of the image folder and jsp as front end having html div element to display the image. I have tried like this to display single image but failed, could anyone please help me out

  <div id="image" style="background-color:yellow;  height:200px; width:100px;float:left;">
  <img src="C:/Desktop/Images/Image1.jpg" style="height:200px; width:100px;floatleft;">

Shoaib Chikate
  • 8,665
  • 12
  • 47
  • 70
user1754940
  • 187
  • 1
  • 3
  • 7
  • Show some code and a description of your error. – Rémi Benoit Oct 29 '13 at 07:57
  • Post your code that you've tried so far pls – Igl3 Oct 29 '13 at 07:58
  • You have a typo here `float:left;` You forgot the : .Have you tried to use the path relative to the path of the html document? – Igl3 Oct 29 '13 at 07:59
  • You said two different things, first "C:/images/" then in your code "C:/Desktop/Images/". You sure you just didn't look in the wrong place? (remember it is case sensitive) – Ruddy Oct 29 '13 at 08:02
  • @Ruddy tried C:/Desktop/Images/Image1.jpg" is correct, but still fails to display – user1754940 Oct 29 '13 at 08:05
  • please check whether the image path given is the correct one or not.. .. – shemy Oct 29 '13 at 08:05
  • @Igle yes that was my typing mistake, but image not displaying yet – user1754940 Oct 29 '13 at 08:06
  • Does it give any errors? for example: "Not allowed to load local resource"? – nkmol Oct 29 '13 at 08:06
  • @user1754940 Are you sure that's the location? Just normally it would be something like : "C:\Users\Username\Desktop\Images" – Ruddy Oct 29 '13 at 08:10
  • @Ruddy, yes the location was correct, not displaying yet – user1754940 Oct 29 '13 at 08:37
  • @user1754940 Well I agree with that guys answer. Move the folder to where your application is. It shouldn't really matter but try it. If still nothing, post the relevant code to that displays the picture, it the linking is fine then it must be the code. – Ruddy Oct 29 '13 at 08:47

2 Answers2

2

Same question in this post: Why can't I do <img src="C:/localfile.jpg">?

but you can use "../" to locate the correct path. http://www.pagetutor.com/html_tutor/missing.html

But why you don't want to make a folder on your on application. It is more easier than access it on your desktop, etc.

Community
  • 1
  • 1
Lian
  • 1,597
  • 3
  • 17
  • 30
0

Why not just move the image to your root folder and link it?
If you need it in the C:/ folder, try doing what Newbie said, and use ../ to find the correct path.