Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Images won't display - mapping problem?

New Here ,
Aug 12, 2008 Aug 12, 2008
My images are stored outside of wwwroot, and they do not display when I browse pages on my production server (it's a virtual private server on hostmysite.com) Everything works fine on my development server, which appears to be set up identically.

My site's pages are in C:\ColdFusion8\wwwroot.
My images are in C:\ColdFusion8\extMySales\topSiteImages. In order to access these images, I created a virtual mapping in the jrun-web.xml file (which is in C:\ColdFusion8\wwwroot\WEB-INF). I have 3 other virtual mappings defined in jrun-web.xml (for example, all my cfc's are in C:\ColdFusion8\extMySales\cfcs) and they all seem to work fine. Here is the mapping for the images folder:

<virtual-mapping>
<resource-path>/extTopSiteImages</resource-path>
<system-path>C:\ColdFusion8\extMySales\topSiteImages\</system-path>
</virtual-mapping>

Here is my code for a typical image: <img src="/extTopSiteImages/logoBig.gif" class="floatLeft topLogo">

But on my pages, a standard icon displays instead of my images, which I assume means the image cannot be found. Any ideas would be appreciated. (I have contacted the hosting company, but their tech support quality seems to be hit or miss, and they have not responded yet.)

Thanks.
Pete
242
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2008 Aug 13, 2008
LATEST
A couple of ideas... First, I would try hitting the image directly from your browser, i.e. www.thedomain.com/extTopSiteImages/logoBig.gif and see what happens. If you get a 404 not found error, then something is screwy with the mappings.

You may consider referencing the image directly through the file system rather than counting on the mapping to resolve the URL. Something like: <img src="file:///C:/PathToFile/extTopSiteImages/logoBig.gif" />

Note the triple slash. We've used this in some places to show images outside of the web root, as well as any time we use an image in a cfdocument tag.

Good luck!

Josh
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources