• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

When will Application mappings not be read?

Explorer ,
Jun 12, 2012 Jun 12, 2012

Copy link to clipboard

Copied

Pretty basic question, but I have had a complete brain dump...

My application.cfc mappings work great...

on cfc calls, queries, cfincludes... basically any CFM related activity.

But they do not resolve  on a <img src='\mappeddir\image.png'> when mappeddir is the correct mapped directory

(and a "fileexists or expandpath on that mappeddir shows  the image does exist -- but then I have embedded the mapping inside a CF function  :|)

Am I missing something in the naming reference, or are there general "non-cf" conditions when a cf application mapping would not fire to the correct directory?

Tx, Tami

Views

522

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

correct answers 1 Correct answer

Participant , Jun 12, 2012 Jun 12, 2012

Mapped directories are referenced within CF code.  In your case that is a HTML image tag.  The browser hits your webserver and asks it for /mappeddir/image.png but your web server has no knowledge of CF mapped directories so it returns a 404.  You can add the same mapping in your webserver if you like, and then it will know how to handle those paths.

In apache you would do something like:

Alias /mappeddir "/Some/Absolute/Path"

<Directory "/Some/Absolute/Path">

Options Indexes MultiViews FollowSymLin

...

Votes

Translate

Translate
Participant ,
Jun 12, 2012 Jun 12, 2012

Copy link to clipboard

Copied

Mapped directories are referenced within CF code.  In your case that is a HTML image tag.  The browser hits your webserver and asks it for /mappeddir/image.png but your web server has no knowledge of CF mapped directories so it returns a 404.  You can add the same mapping in your webserver if you like, and then it will know how to handle those paths.

In apache you would do something like:

Alias /mappeddir "/Some/Absolute/Path"

<Directory "/Some/Absolute/Path">

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

</Directory>

In IIS you would create a virtual directory.

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
Explorer ,
Jun 12, 2012 Jun 12, 2012

Copy link to clipboard

Copied

LATEST

Yea... I know... was just hoping there was some magic fairy config that I could set up. Since only a few images are not references dynamicaly, the case for mapping on this project is low...

thanks Sean for confirming -- but magic fairy config would have been awesome

T--

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