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

Relative Image Paths in CFDOCUMENT

Guest
Feb 06, 2008 Feb 06, 2008

Copy link to clipboard

Copied

Hi Everyone,

Why can my Dev Box read relative image paths inside a CFDOCUMENT tag, but my Production Box cannot? and how can I get my Production Box to read them?

Example:
This only works on Dev: <img src="/myRelPath/myImage.gif">
This works on both Dev and Production: <img src="file:///D:\myAbsolutePath\myImage.gif">

I need to be able to use the relative syntax on Production because I'm using <CFIMAGE action="writetobrowser"> inside the CFDOCUMENT. This means the final <img> tag is being rendered with a relative path and I have no control over the SRC attribute.

One options I have thought about is to wrap a <cfsavecontent> around the <cfimage> tag, then replace() the relative path with the absolute path.... but since the PDF content is in a dynamic loop, that can end up being a lot of overhead. I would rather just be able to get CFDOCUMENT to recognize relative paths on my production box...

Any Ideas?

Thanks,
TOPICS
Advanced techniques

Views

401

Translate

Translate

Report

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
Guest
Feb 08, 2008 Feb 08, 2008

Copy link to clipboard

Copied

LATEST
Ok, one of my guys here figured it out.

We added our domain to the host file on the machine and it fixed it.

Votes

Translate

Translate

Report

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
Documentation