Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So, I helped out at the local CoderDojo yesterday. The kids were starting on building a web page, and so downloaded a simple web site from here[^]

They unzip it, open the html in their browser, and in notepad. Then they change the details on the page, save and refresh.

simples!

Now they want to change the picture. so they browse, find an image they want to use, download it to the images folder, change the img tag in notepad and refresh the browser.

And no Image Is displayed.

A quick check around the 'class' and I find only those with Internet Explorer are having problems. (both on windows 7 and 8 - I didn't check the IE versions, but I have just spun up a VM using IE 10 and have the same experience)

It appears that IE will ONLY use images that pre-exist in the folder. Downloading any new image, IE refuses to show it in the page!

Open the same html in Chrome and it shows the image.
Open the image itself in IE and it displays it.

The html is below.

I would have thought that it was something to do with IE's "Internet Zones" or something - except it works with all pre-existing images extracted from the zip!

I am puzzled! Anyone know what's going on?

XML
<!DOCTYPE html>
<html>
<head>
<title>About Me</title>
</head>
<body>
<h1>About Me</h1>
<p>My name is Lee Go.</p>
<p>I live in Bray, Ireland.</p>
<p>I am ten years old.</p>
<p>This is my photo:</p>
<p><img src="images/NotWorkingImage.jpg"/></p>
</body>
</html>
Posted

Well, strange as it may seem, Unblocking the zip file does the trick - as does unblocking the html file after unzipping.

it seems to be the case that opening the 'blocked' html file allows it to see only those files that are also blocked (although you can't unblock the jpg etc. files so maybe it is keeping track of the original source?)

Funny thing is that, on my work PC I got a warning when I opened the html (Do you want to open this file? While files from the internet can be useful, this file type can potentially harm your computer...") but on my Win 8 VM at home and a physical win 8 machine at work (and I"m pretty sure, the kid's computers at the dojo) no warning at all.

MS - that's poor. Don't give a warning or an error anywhere, but just refuse to open a file! Furthermore - open files that were dopwnloaded with the original, but don't open any others!?

So - I know the cause, but I don't understand it!
 
Share this answer
 
Comments
Richard Deeming 16-Mar-15 9:34am    
This feature was added in XP SP2 - when a file is downloaded from the Internet zone to an NTFS volume, it adds an alternate data stream called "Zone.Identifier" to the file to indicate which IE zone it came from. This feature can be disabled in Group Policy:
Understanding The Internet File Blocking and Unblocking - Dixin's Blog[^]

You might also end up with a "Mark of the Web" comment in the HTML file, which indicates which zone it should use:
Mark of the Web (Internet Explorer)[^]
There is nothing wrong. Well, the p element around img element could be redundant. As to the problem of the image. The provided path is the path relative the the HTML file you show; also, the name might be case-sensitive. Put the file in the specified location or change the path in this element appropiately; and it will show; I'll guarantee that.
—SA
 
Share this answer
 
Comments
_Maxxx_ 14-Mar-15 23:27pm    
Try it - it doesn't.
The spelling, capitalisation etc. are correct - did you not see that it worked fine in Chrome? The file is in the specified location - other files in the specified location are displayed correctly if only the file name is changed.

What do you provide with your guarantee? As I can guarantee (and am prepared to put up financial surety) that it does not display.
Sergey Alexandrovich Kryukov 14-Mar-15 23:43pm    
I can create a file with this exact name; it will show. How did you get file name? Do it by copy/paste; check up the file itself, that it is correct JPEG. Are you saying that it works if you renamed the same file?
—SA
_Maxxx_ 15-Mar-15 0:34am    
It doesn't matter what name the new file is given, it will not display. Any of the existing files display fine.
e.g. There is an existing file dog.jpg - change the html to show that and it is fine. rename dog.jpg to abc.jpg, refresh, noting shows (as expected). rename my image to dog.jpg and still nothing shows. Change the html to show abc.jpg and it does show.

In summary; any existing image file in the images folder displays fine, even if renamed.
Any new image downloaded into the images folder, will not display, even when renamed.

This experience survives a complete reboot.

I am testing on a completely brand new build of Windows 8 - so I know there are no other copies of the files on the machine.

It also occurs with every image I have downloaded to test. e.g. I googled "cat image" right-clicked on the first image I found, downloaded directly into the images folder, re-opened the web page from the file system, and the image does not show.

Opening the same file in Chrome works fine
_Maxxx_ 15-Mar-15 0:39am    
Also, creating the folder structure manually, creating new html file with the same contents, and downloading the same cat image to the images folder works fine.
So it would appear to be associated with the folder structure that has been downloaded in the zip file in some way
phil.o 15-Mar-15 4:28am    
Does the problem still persist if your clear IE's cache?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900