Gossamer Forum
Home : Products : DBMan : Customization :

File upload problems

Quote Reply
File upload problems
Love this program. But when tryin to make th eupload program work I get a 500 error when the script runs. I have tried the html.pl mods and default.cfg with the original db.cgi and all runs but of course the field are messed up but when i bring the db.cgi into play i get a 500 error. The only thing I can guess is maybe my path is wrong. What should a path be? I have my web site at www.horsesearchplus.com and the images directory is listingimages and is in my main directory. I do run the script from another url since this web site uses a shopping cart and they tell me they disable cgi with the shopping cart in place. Everything worked great till the upload mod!! Any help is appreciated.

my files can be found at
http://www.allen-pinckard.com/cgidbman/dbcgi.txt
http://www.allen-pinckard.com/cgidbman/defaultcfg.txt
http://www.allen-pinckard.com/cgidbman/htmlpl.txt

and the images should be stored in
http://www.horsesearchplus.com/listingimages
and the scripts are called from
http://www.horsesearchplus.com



thank you
greg67@home.com

Quote Reply
Re: File upload problems In reply to
Somehow when you installed the mod, all of the new lines in sub delete_records ended up on one line. Below is the code you need to replace, keeping all of the individual lines.

Code:

($restricted = 1) if ($auth_modify_own and !$per_admin);

LINE: foreach $line (@lines) {
if ($line =~ /^$/) { next LINE; }
if ($line =~ /^#/) { $output .= $line; next LINE; }
chomp ($line);
@data = &split_decode($line);
($output .= "$line\n" and next LINE) if ($restricted and ($db_userid ne $data[$auth_user_field]));

if ($delete_list{$data[$db_key_pos]}) { # if this id is one we want to delete
$delete_list{$data[$db_key_pos]} = 0; # then mark it deleted and don't print it to the new database.
if ($db_upload) {
opendir (GRAPHIC, "$SAVE_DIRECTORY") or &cgierr("unable to open directory in delete records: $SAVE_DIRECTORY. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
$file_test = $data[$db_key_pos];
foreach $file (@files) {
if ($file =~ /^$file_test\./) {
unlink ("$SAVE_DIRECTORY/$file");
}
}
}
}
else { $output .= $line . "\n"; }
}
foreach $key (keys % delete_list) {
(There's an extra space in the last line above between the % and delete_list. Either don't copy and paste that line or be sure to remove the space.)


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: File upload problems In reply to
:) I also checked the rest of the code and found the validat was like that also. All th elines got pasted into one line.

It works now. Thank you very much. No 500 error. Now to see if I have my paths right. :)

Quote Reply
Re: File upload problems In reply to
looks good but the files are not being found
i think i need to tweak around with my path to see where they are going

again thanks for the help


Quote Reply
Re: File upload problems In reply to
well the paths i think hve me now
The program works and is writing my files and changing them to 1.jpg etc....
But the thing wont work if I make my paths like the following all I get is a blank screen.
It says you found 5 records but it does not show any records. Think my path is wrong. listingimages is a sub directory under my root and the notes say do not use a url so should my path be /listingimages ???


$SAVE_DIRECTORY = "/listingimages";
# Full URL to directory for uploaded files. No trailing slash please.
$SAVE_DIRECTORY_URL = "http://www.allen-pinckard.com/listingimages";

Quote Reply
Re: File upload problems In reply to
Your directory should be the full path to the directory, not a relative one.

As for getting a blank screen, I have my doubts this is caused by problems with the upload mod. Go back and check your page. View the source code and see if there is anything there at all. If there is, you probably have missed a closing table tag somewhere.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: File upload problems In reply to
it is working now
after i made my save directory correct everything started working fine
images look nice :)
thank for your help
these things can be a bear sometimes

Quote Reply
Re: File upload problems In reply to
Oh, yeah!! I know how hard it is to track things down sometimes.

I'm glad you were able to work it out.

Take care.

JPD
http://www.jpdeni.com/dbman/