• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IMG not displayed when inside server (tomcat)

 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a very simple page, sample.html, with nothing inside but 1 img tag



If I open this sample.html by double-clicking it in windows explorer, it opens as expected.

If it is served from the server, the image is not displayed.

Any thoughts?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would a page served from a server include an image tag that references an image that's on the client? This page would only work on your machine, not anywhere else.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
Why would a page served from a server include an image tag that references an image that's on the client? This page would only work on your machine, not anywhere else.


Sorry I just realized that; i asked the wrong question.

Actually, my problem is:

I have an empty table TD tag, with id, like below:



Now, I use javascript .innerHtml to put an IMG tag inside it, as below:



The image is not displayed.

(I checked by checking the value of the imageHolder and I get the correct data "<img src='C:/image/A.jpg'>", but there is no image displayed.)
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never tried that (as I said, I don't think it makes much sense), but it could be a security restriction that pages from a server are not allowed to reference local files.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The page is already served at the client when I triggered the change for IMG tag.

The image exists in the client PC.

I also am looking at the possibility that it is related to security.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most modern day browsers do not let you link to local files.

Eric
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eric Pascarello:
Most modern day browsers do not let you link to local files.

Eric


If say I will allow even there is security hole on the resolution, is there any such way, so that I can do so and have my image displayed?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic