tags:

views:

537

answers:

2

I have this tag in my page that runs on localhost:3000 <img id="img1" src="file:///Users/michal/Desktop/Picture 1.png" width="400" height="200"> image do exists but it is not displayed. if i put path from src attribute into address bar image is loaded but it doesn't work in img tag not even in iframe tag. I'm using Safari 4 on Mac. Am I missing something or it is not possible at all? Thanks.

+3  A: 

That's a security feature .. it isn't possible in any browser on any platform.

eduffy
+1  A: 

Must be a Safari 4 issue. Seems to work fine on Safari 3.2.1 and Firefox 3.0.10. I use similar thing and it works:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 1 September 2005), see www.w3.org">
<title></title>
</head>
<body>
<img id="img1" src=
"file:///Users/ryan/.../wait.gif"
width="400" height="200" name="img1">
</body>
</html>

I think if you are running localhost:3000, then the above answers are correct with the security. Try using relative path without the file://

Ryan Oberoi
Was that page hosted? or did you access via the file:// protocol?
eduffy
eduffy - you are right about the hosted part. I was in the middle of editing my response. I think Michal will have to use relative paths to view that image - and not use the file:// to refer to that image.
Ryan Oberoi