This img path working IE but not in chrome and firefox. However if I use same img path in any browser url it works. src="file:///C:/Users/d4katas/Documents/image/Test.jpg"
Asked
Active
Viewed 661 times
0

Popnoodles
- 28,090
- 2
- 45
- 53

sam
- 1
- 1
-
How is this related to Java in any way? – dcsohl Oct 25 '16 at 16:49
-
@Popnoodles yes I tried with using 2 slashes as well. still same issue. – sam Oct 25 '16 at 16:49
-
@dcsohl because page is xhtml however the code is java. Java developer might have came across this situation – sam Oct 25 '16 at 16:50
-
Possible duplicate of [Firefox doesn't show images from a local file path](http://stackoverflow.com/questions/17100991/firefox-doesnt-show-images-from-a-local-file-path) – vickisys Oct 25 '16 at 17:22
1 Answers
0
Is your web page being served from a file server? If so then your cannot call out a local file on your computer as an img src. Try moving the image file into your web server and src'ing it appropriately from there instead.
IE might be working because... well, it's IE... it tends to do things that it shouldn't. :)

Dave Cripps
- 929
- 7
- 11
-
is there any other option because images will be on client server(client domain). I was just testing on my local. Client is not ready to move the images on weblogic folder – sam Oct 25 '16 at 17:01
-
Are you dealing with a different server or a user's local computer? If on a different server they can still reside there but they have to be shared and accessible via the web if you want to use them in a web page being served from a different server. – Dave Cripps Oct 25 '16 at 17:04
-
Right now I am working on local however client will also provide us the similar file path as deployment with be on client server and where the images will be on that server network path.So client will give me path like file://///iso19prod/NAPDC_AUS_Images/Approved/AH225363.jpg – sam Oct 25 '16 at 17:10
-
If that is a relative path from the client's web root, then you will need to mirror that same path (directory) structure on your local development box to properly simulate the deployment environment. Bottom line, you cannot call a "local file" on a user's computer from an img src. Chrome and FF will not allow it for security reasons. – Dave Cripps Oct 25 '16 at 17:23