JPEG Images Being Copied to Root with Garbled File Names on IIS7 Web Server

What is happening is that whenever our website tries to load a JPEG file from a non-local source (another website for instance), it appears fine in the raw html but when the page is displayed in a web browser the file name changes from 'http://www.website.com/image.jpg' to '/0ac5dd22599c9a2e9ced06e1aaee901f.jpg'.  The file name is always different, but is always a long string of characters like that.  It loses whatever web address it had and appears like that.  At the same time it creates a copy of the image of the root directory of the server drive (C:\) with the same file name.  Of course since the website proper only sees what is in its folder (C:\inetpub\wwwroot\) it can't see any of those files and just displays a broken image.

So what we know is:
- We are using IIS 7 for the web server.
- It only affects JPEGs.
- It only appears to affect non-local sources. Locally hosted JPEGs inside the wwwroot folder display fine.
- The same JPEGs work fine when tested on another web server.
- The other web server is a clone of the affected one, yet performs normally.

We are about to toss this one in the pile of Great Mysteries along with 'Bigfoot' and 'Why People Liked Achey Breaky Heart', so any and all ideas are welcome and we thank you in advance.
LVL 3
IKtechAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
That is far too vague and web sites do not copy images.  Programs do.  And clearly the other web server is not an exact clone since it does not act the same.

How are you loading and copying the images?
David Johnson, CD, MVPOwnerCommented:
the devil is in the details
IKtechAuthor Commented:
The images are being linked using HTML <img> tags on web pages. The Source for those <img> tags are for images hosted on other sites, but we somehow are ending up with the image file - with a different gibberish file name - saved on the server.

Most of the images seem to be connected with a Wordpress plugin that imports posts from an external provider. However, the HTML doesn't have anything special about it.  It's just an <IMG> tag for all these images with a width of 100%.  Also, the back up server has the identical plugin running and does not have this issue.  A small number of the images were actually uploaded using the Wordpress upload media function, and would appear fine in previews but when the post was published would become broken images with a gibberish name, and the image file with the gibberish name would appear in the root folder.

And yes, while certainly it is evident that there is some clear difference in how the two servers are operating, they both have the same identical settings (we have triple checked while investigating the issue) and the second server was created as a copy of the main one.

The problem is two fold:  the URLs for these <img> tag sources are changing between being saved and being viewed as a web page somehow, and then the image files are appearing in the root directory of server drive, outside of the public web folder and the website root folder (Hence why we suspected IIS would be the culprit and not Wordpress).  But we cannot find anything on how another case of this happening, and quite honestly are very baffled on how it can actually happen because as you have said - images are not supposed to be copied.  Yet here we are, with a copy of external images that have been linked appearing on our servers.

The devil may be in the details, but we haven't the foggiest on where we would even start looking for the culprit causing this mayhem.  Is there anything with IIS that handles how external image links are displayed for instance?
Dave BaldwinFixer of ProblemsCommented:
IIS does not know that the images came from an external site.  Those images are just files to IIS.  External image links are just text that is delivered by IIS and are only used by the browser to fetch images.  I would have thought the images names are in the Wordpress database.

Now Wordpress and your plugin can make any changes they want.  I know that Facebook creates image links and file names like you show above in an attempt to make sure they are unique file names.  And IIS doesn't 'reach out' to get files or posts from other sites, only Wordpress does that.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.