This project is read-only.

Images are not displayed

Aug 16, 2009 at 5:52 AM
Edited Aug 16, 2009 at 5:53 AM

I updated to 1.5 on my local development box today and now none of the images in my blog are displayed anymore. I then downloaded the 1.3 version from the live server to the local server and the same thing is happening with 1.3, too. The exact copy on the live server works just fine.

Any ideas what could be going on here?


Aug 16, 2009 at 10:42 AM

Not sure, but are you using the latest web.config file that comes with BE 1.5?  What version of IIS are you using?

If you're using an older version of the web.config file and IIS7 is the web server, the image handler (image.axd) may not be configured correctly.

Can you pull up the RSS feed?

Aug 16, 2009 at 11:03 AM

Also, if you right click on one of the images that isn't coming up and get the URL to the image (or get the URL to the image via your browser's View Source), try navigating directly to the image via the URL.  See what comes up.  There could be a helpful error message, for example.

Aug 16, 2009 at 9:30 PM
Edited Aug 16, 2009 at 9:31 PM

Thanks. Looks like something is wrong with the image handler. Navigating directly to the image gives:


The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, 
had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it
is spelled correctly. Requested URL: /image.axd


I'm running IIS 5.1 on Windows XP locally. I think the live site is hosted on IIS7. I'm using the web.config straight from the installation for the BE 1.5 site, and for the BE 1.3 site a copy of the web.config file coming from the live server. So it looks like the web.config works with IIS 7 but not with IIS 5.1.

What do I need to do to make BE work with IIS 5.1 again?

Aug 17, 2009 at 12:04 AM

On your local machine, is the blog installed directly in 'localhost', or is it installed in an application folder (e.g. BLOG)?  In other words, what is the URL to the blog's homepage?  And what is the URL to the image.axd file?

Did you copy over pre-existing blog posts from the live server to your local machine?

I'm guessing that on the live server, the blog is installed in the root of the website.  If you have your blog installed on your local machine also in the root "localhost" folder, the URL to the images should be the same as they are on the live server.

However, if you have the blog installed on your local machine in an 'application' folder, such as:


Then the URL to image.axd is probably not matching what it is on your live server.

If this is the case, try creating a new blog post on your local machine, and include an image in the new blog post to see if it works.

If your blog is installed in a folder (e.g. BLOG) on your local machine, then the following path to image.axd won't work.


The URL would instead need to be:


So, I'm saying that the image.axd handler probably does work, but the path to it isn't the same on your local machine as it is on the live server.  In this case, images for pre-existing posts you copied over from the live server won't work unless you manually change the path to image.axd in each of the blog posts.

Aug 17, 2009 at 4:31 AM

You are correct. On my local machine the blog is located at http://localhost/blog13.

So where do I change the path to image.axd?


Aug 17, 2009 at 6:44 AM

Unfortunately, there's not a single place to change it.

If your posts are stored in the App_Data folder (rather than the DB), the posts will be in the App_Data\posts folder.  There will be a single XML file for each post.  The image tag is in the post <content> tag.  So you would want to do a search and replace of the content in the <content> tag.  Replace /image.axd with /blog13/image.axd.

If your posts are stored in a database, similar procedure.  The post content will be a column named PostContent (or similar, don't remember exactly).  You would want to run an UPDATE statement on this column to replace /image.axd with /blog13/image.axd.

Another, cleaner way to do it would be to create C# code that goes through all the posts and updates the Content.  Something like this:

foreach (Post p in Post.Posts)
    if (p.Content.IndexOf("/image.axd", StringComparison.OrdinalIgnoreCase) != -1)
        p.Content = p.Content.Replace("/image.axd", "/blog13/image.axd");

Oct 21, 2009 at 7:21 PM
Edited Oct 21, 2009 at 7:35 PM

The another scenario for this issue is, When you restrict to show specific no of characters in description of the post. You can control/do this on "Settings" page.