Solved

Images in sub folder won't load in IIS 7

Posted on 2014-10-28
16
531 Views
Last Modified: 2014-11-04
The following code shows the graphic if located in the root directory and will not show the graphic in the images folder.  Windows Standard 2008 64 bit with .NET 2.0



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IIS7</title>
<style type="text/css">
<!--
body {
	color:#000000;
	background-color:#B3B3B3;
	margin:0;
}

#container {
	margin-left:auto;
	margin-right:auto;
	text-align:center;
	}

a img {
	border:none;
}

-->
</style>
</head>
<body>
<div id="container">
<img src="/Images/welcome.png" alt="IIS7" width="571" height="411" />
<img src="Logo_Main.gif" alt="Logo_Main" />
</div>
</body>
</html>

Open in new window

0
Comment
Question by:bob_mechler
  • 9
  • 7
16 Comments
 
LVL 13

Expert Comment

by:Michael Machie
ID: 40409380
Take the leading '/' off the '/Images/welcome.png' . Works fine and shows the Welcome.Png file to the left of the Logo_Main file.

As it sits, you will currently see the alt name of IIS7 to the left of the Logo_Main where you actually want welcome.png to show. The link to the file is not understood and my html editor shows a broken link for that reference.  Remove that slash and it will show fine.
0
 

Author Comment

by:bob_mechler
ID: 40409871
Made the change, cleared all browser history and did not change on either Chrome or IE
Revised code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IIS7</title>
<style type="text/css">
<!--
body {
	color:#000000;
	background-color:#B3B3B3;
	margin:0;
}

#container {
	margin-left:auto;
	margin-right:auto;
	text-align:center;
	}

a img {
	border:none;
}

-->
</style>
</head>
<body>
<div id="container">
<img src="Images/welcome.png" alt="IIS7" width="571" height="411" />
<img src="Logo_Main.gif" alt="Logo_Main" />
</div>
</body>
</html>

Open in new window


Any other ideas?
0
 

Author Comment

by:bob_mechler
ID: 40409874
Under Roles for this Windows Standard (not R2) 2008 Server 64 bit there are the following roles besides Web IIS
1. Active Directory Domain Services
2. DNS Server
3. File Services.

Would any of these require more specific permission granting?
0
 
LVL 13

Expert Comment

by:Michael Machie
ID: 40409892
Not sure what to say. I replicated your scenario and also replicated the fix I sugested. I tested with both IE11 and I think Firefox32.

Is this Server local to you or hosted by someone? I have seen a hosted server refresh the code on intervals before, which would cause a delay in seeing your changes on the live site. This would not take hours though, more like minutes.
0
 

Author Comment

by:bob_mechler
ID: 40410451
It's a leased server (one of several) accessed via an external IP address using RDP. I'm running my test inside IIS 7 and on IE, Chrome as localhost. The app is just a slightly modifiied iisstart.htm Default website.

Tried it again this morning with the same results. Someone else set up the server. I've even tried uninstalling WEB IIS and re-installing. This server is also used as a company wide FTP Server. (Which I've argued against). If I have to grant more permissions to the sub folders, I just need to know exactly how to do it.
0
 
LVL 13

Expert Comment

by:Michael Machie
ID: 40410499
I dont actually know why you cannot view it. I am a local admin on my laptop and saw it fine loading it all locally.
Ill put these files up on one of my hosted and one of my local web servers and see if there is any difference or something noticeable to me.
0
 

Author Comment

by:bob_mechler
ID: 40410535
I appreciate it. I'm currently uninstalling the Web IIS Role so I can reinstall it and make careful notes of each item I'm including in the install. Originally I thought it was because I was installing a ASP.NET 1.1 app the day before to see if it would run on the 64 bit machine. It would run  once I set up the ASP.NET 1.1 APP POOL except for images and CSS which were both in sub folders. The bin, xsl and template files were all in sub folders and they worked fine.

The only 64 bit Windows Standard 2008 machines that worked without a hitch were Web only versions of the software.

I rolled IIS back to nothing but the default web site and changed the iisstart.htm to have the welcome.png in a sub folder and another random graphic in the root folder. That is where I am now.
0
 
LVL 13

Expert Comment

by:Michael Machie
ID: 40410559
Ok, ill see what I come up with and let you know.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:bob_mechler
ID: 40419473
After reinstalling WEB IIS 7 on the Windows 2008 Standard 64 bit and reinstaling my application as DefaultAppPool it looks like the attachments.
screenshot.bmp
defaultwebsite.bmp
0
 

Author Comment

by:bob_mechler
ID: 40419478
Screenshot.bmp shows an application where all graphics are in a sub folder titled \Images and all CSS files are in a sub folder named \CSS. defaultwebsite.bmp is kind of my control since I started with iisstart.htm and just added one image to  subfolder. The Image in the root folder loads but the one image in the subfolder does not.
Here is the code again for the default web site.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IIS7</title>
<style type="text/css">
<!--
body {
	color:#000000;
	background-color:#B3B3B3;
	margin:0;
}

#container {
	margin-left:auto;
	margin-right:auto;
	text-align:center;
	}

a img {
	border:none;
}

-->
</style>
</head>
<body>
<div id="container">
<img src="Images/welcome.png" alt="IIS7" width="571" height="411" />
<img src="Logo_Main.gif" alt="Logo_Main" />
</div>
</body>
</html>

Open in new window

0
 
LVL 13

Expert Comment

by:Michael Machie
ID: 40420227
This is an odd one.. I was able to copy your code exactly, set up folders as your code points to, name some graphics with the same names, and everything loaded for me fine. I even uploaded it to one of my Web Servers exactly the way I have it described and here is the link:
Test from one of my webservers using your code

Obviously my pics are not yours, but I renamed them exactly the way you have it.
1) I created a 'IIStest' folder.
2) Within this folder I dropped in your code saved as index.html, dropped in the pic named Logo_Main.gif, and created a folder called 'Images'
3) Inside the Images folder I dropped in a pic named welcome.png (see Pic1)
pic14) I double-clicked the 'index.html' file and Pic2 is what I get in FireFox - exactly what you wanted to have based on the code you provided.
pic2
At this point I guess you could ask other Experts for assistance.
0
 

Author Comment

by:bob_mechler
ID: 40420460
Ok. The only differences are the other roles set up in the server manager.
1. Active Directory Domain Services
2. DNS Server
3. File Services.
I didn't set them up, but I can't help but wonder that something in those roles is making everything under InetPub require permissions that it doesn't already have. There is only one of our customers with a Windows 2008 Standard 64 bit server set up as a web server. It works fine. Then again, the only role defined on that server is the Web IIS role.

bob
0
 
LVL 13

Accepted Solution

by:
Michael Machie earned 500 total points
ID: 40420469
Odd question, but is the Images directory a virtual directory? I mean, is it located on a different Server with a virtual path pointing to it from your Web site? This would not be a normal set up but I have seen issues with Virtual Directory permissions causing the inability to access a folder structure on a FTP site, so figured I'd ask this.

If this IS the case, then I'd access 'Everyone' to that folder and would also suggest you use either the remote server's IP address or at least FQDN to rule out a DNS problem.
0
 

Author Comment

by:bob_mechler
ID: 40420609
It's not a virtual directory. Thanks for additional things to try. I do remember that some web sites I've encountered didn't act right until I accessed them via an external ip address.

I'll also try the Everyone approach and report back. I'm lacking in the permissions dept as well as how to set the pool to run as anything other than a network service. ApplicationPoolIdentity was not available which seemed odd.
0
 

Author Closing Comment

by:bob_mechler
ID: 40422043
Excellent effort. My bad for missing a spelling error in the default web site's physical directory.
0
 
LVL 13

Expert Comment

by:Michael Machie
ID: 40422167
Great job finding the underlying issue! Sometimes it is the smallest things that cause us the most problems haha.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now