[ic] More about images in /pages directory

Mark Johnson interchange-users@lists.akopia.com
Tue May 29 10:12:01 2001


Jason Timm wrote:
> 
> Hi,
> 
> Thanks for the tip - that did answer some questions, but...
> 
> 1) Say we have an image in the /pages directory such as /pages/title.gif.
> If we then go to www.foo.com/cgi-bin/storefront/title.gif, we get a message
> that says:
> 
> Sorry, the page (title.gif) was not found
> The requested item (title.gif) was not found. You can return to browsing our
> catalog, if you wish.
> 
> So, for some reason it does not allow us to reference an image file in the
> /pages directory even if we get to it via a browser directly as opposed to a
> [page] or [area] tag.  Is there a way to make this work?

You are in for some work if this is truly your only option. In fact, I'm
not even certain it can be done, but if so, this is what you'd have to
do. In an autoload, you'll have to reset the config to use the current
extension of the URI as the "seen" extension, which you could set to be
some limited number of extensions so only the files you want served will
be served. Again, I'm not even certain this would work, but it would be
something like this line in an autoload routine:

  $Vend::Cfg->{HTMLsuffix} = '.gif';

for a gif image, where you got a request for a gif from based on the
URI.

Basically, Interchange will only allow a single file extension to be
"seen". Also, be aware this means every image load now has to pass
through Interchange, which will increase your load significantly as a
new CGI/IC process will have to start/fork for each image in the page.
Ouch.

> 
> 2) Also, the <img src="title.gif"> tag seems to add /storefront/images to
> the image reference yielding:
> 
> /storefront/images/title.gif
> 
> Is there a variable similar to [set mv_add_dot_html][/set] which would allow
> us to turn off the addition of the /storefront/images to the image source
> attribute?  If there is not a variable, is there another way to accomplish
> this?

This is controlled by the IMAGE_DIR value in variable.txt. Reset it to
/cgi-bin/storefront

Note: I think Jon Jensen is right. You should find another way to handle
this. Perhaps a symlink from the HTML space into a directory under the
catalog root would do the trick?

In any case, good luck.


> 
> Note: I know the easy answer would be to just not put images there, but the
> application we are building requires it.  Thanks for your help in advance...
> 
> Jason
> 

-- 
Mark Johnson
Senior Systems Architect - Professional Services
Red Hat, Inc.
E-Business Solutions
markj@redhat.com
703-456-2912