[ back to toc ]

cgi script problems

Date: 2002/04/09 10:42

Q:
Hello,

I've got a site that we need to put a script on that will function as a
photogallery and admin area. I've downloaded and installed fotofolder
(from
http://www.uplink.com.au ). I've gotten everything to work (meaning I can
enter the admin area, add a new image, go to the modification area and
update the description text, as well as page through the photogallery.)
The problem that I am having is that the image itself does not upload to
the
server (even though it says that the image was successfully added to the
database).

I think all of the paths and permissions are set correctly (I've had a
friend with more programming experience than myself look at it, and he
thinks
it all checks out. He even installed the script on his own server and
comes up with the same problem, where the photo does not upload). Any help
you can give me about this will be greatly appreciated. Below I will paste
text from an e-mail I sent to this friend (who reccomeneded this site to
me). It's got all of the specifics as well as links.

Thanks in advance for your help.
*NAME-DELETED*

===========================

I tried what you suggested (deleting and re-uploading the
files/directories) but I've still had no luck getting the images to
upload. I really appreciate any help you can give me. Here is the basic
info for the script. You can test out the way it will look on the site
at: http://www.jamesdeancustomseats.com/test.html

The script itself is at
http://www.jamesdeancustomseats.com/cgi-local/fotofolder/fotofolder_lite.c
gi
- this brings up the photogallery page. To reach the admin area it is at
http://www.jamesdeancustomseats.com/cgi-local/fotofolder/fotofolder_lite.c
gi?action=admin
(user: admin / pass: password) I've set the file permission to the
cgi-local and fotofolder directory to 777. (The readme file did not
mention what to do about CHMOD'ing the directory themselves - they only
say to 755 the cgi file and 777 the text and html files, which I have
done.)

I've updated the html file (
http://www.jamesdeancustomseats.com/cgi-local/fotofolder/fotofolder_lite_w
rap.html
) to look the way I need it to. Otherwise the only thing that I have
changed in the cgi file is the first line which points to perl (used to
be #!/usr/bin/perl - had to change it to #!/usr/local/bin/perl ) and the
setup variables portion also at the top of the file. The original file
has this information:

### -- Begin Setup Variables -- ###
# See README.TXT for explaination of these variables

$imgPathWeb = "/images/";
$imgPathCGI = "../public_html/images/";
$tableWidth= "750";
$adminPWD = "password";

$imgCellColor = "lightsteelblue";
$imgDescColor = "white";
$imgPartColor = "#EEEEEE";

### -- End Setup Variables -- ###

The updates that I made to the file read like this:

### -- Begin Setup Variables -- ###
# See README.TXT for explaination of these variables

$imgPathWeb = "/images/fotofolder/";
$imgPathCGI = "../public_html/images/fotofolder/";
$tableWidth= "650";
$adminPWD = "password";

$imgCellColor = "#C6C3C6";
$imgDescColor = "#C6C3C6";
$imgPartColor = "#C6C3C6";

### -- End Setup Variables -- ###

I've tried a number of different things in the two imgPath lines but
nothing seems to work. (I would prefer to keep images uploaded for this
separate from the regular image folder, so I created the directory
images/fotofolder. The readme file also does not say what to do about
setting file permissions to the image directories, but from our
discussion on Friday when we had everything working, I've set both the
'images' and 'images/fotofolder' permissions to 777.

If only I can go back in time to when we got it to work! I don't know
what I did to make it stop working, but hopefully you can help me out. I
really do appreciate any insight you might have as to how to get this
working! I'm sure it's some minor little thing - one little line
someplace, or a permission set wrong. But for the life of me, I can't
figure it out. (This is showing me that I'm definitely a designer, not a
programmer!)
A:
What I can see from the source is that the $imgPathCGI variable contains
relative path, which may not be appropriate. A relative path is relative
to the current working directory, which may not be the directory where the
script is.

You have to set the directory permissions as well. Start chomd 777 them
and if everithing works try to set it more restrictive as you can.

Regards,
Peter
Q:
Peter,

Thanks for your response. I had tried both of those things before without
any luck, but I will try them again to see if things work differently this
time (I'm not too hopeful, though...)

I appreciate the time you took to send me your suggestions. Two of the
other experts were not able to offer suggestions. I will let you know if
this works.

Thanks again,
*NAME-DELETED*
A:
Thanks if you notify me.

regards,
Peter

[ back to toc ]