Link to home
Start Free TrialLog in
Avatar of shahrahulb
shahrahulb

asked on

cgi

i have a directory structure:

/v/blah.com/ast/

ls -l gives 3 directory
images
data
www

if we go to www and ls -l  i have

/www/oos/oos.cgi

in my cgi script
use CONFIG;

print"                <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#3399CC\" width=\"100%\" height=\"60\">
<tr>
<td colspan=\"2\"    BACKGROUND = $CONFIG::IMAGE/1pixelwidth.gif id=\"fillbgtop\"><IMG height=25 src=http://www.xyz.com/images/clear.gif border=0></td>
</tr>
                </table>
";

it is not abe to read imgae $CONFIG::IMAGE/1pixelwidth.gif

CONFIG.pm contains
our $IMAGE = "/v/blah.com/ast/images

why??
Avatar of shahrahulb
shahrahulb

ASKER

if the image is present in  /v/blah.com/ast/www/oos

and if i use  BACKGROUND = $CONFIG::IMAGE/1pixelwidth.gif

then it works fine

but i wantto store all my images in sepertae directory
what is DocuemtRoot of your server?
Avatar of Tintin
You are confusing directory paths with URL paths.

/v/blah.com/ast/images is the path on the server.  In almost all cases, this is not the same path that is used to access an image in that directory via the webserver.

At a guess, you should set

$IMAGE = 'images';

Assuming of course, that the images directory is within your Document Root or has be set up with an alias.
only the image is not working

if i use

 my $c = File::CounterFile->new("$CONFIG::DATA/$file"); in my cgi script
this works fine

CONFIG.pm contains: our DATA = "/v/blah.com/ast/data"
Did you update the setting for $CONFIG::IMAGE as suggested?

What URL do you use the view the image in your browser?  Once you know that, you have the image path you need to use.  I think you will probably just need to set it to '/images'

url is  http://blah.com/oosui/oos-ui.cgi

location of oos-ui.cgi  =   /v/blah.com/ast/www/oosui/oos-ui.cgi
location of images     =   /v/blah.com/ast/images
DocumentRoot /v/blah.com/ast/www
mv /v/blah.com/ast/images /v/blah.com/ast/www/oosui/images

then in CONFIG.pm:
our $IMAGE = "/v/blah.com/ast/www/oosui/images"
i know this already  but i want to seperate my image file from oosui directory
Unless you change your webserver configuration, you will need to move your images under your document root, otherwise they will not be viewable.
SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial