Gossamer Forum
Home : Products : DBMan : Installation :

Upload Mod: Internal Error

Quote Reply
Upload Mod: Internal Error
Hi all,

I have installed DBman on my server & it works fine....but when I got to install the "upload_mod" script..it's gives me error...I have turn on the debug, it appears nothing except this message on the page "DBMan encountered an internal error. Please.............."

While the debug is set on, it can't display the error, I've searched the forum no matching like this error... Maybe there is simple mistake I can't find it..so, I need your help....

Here is the scipt that I modify it in TXT format files:

www.zeinelomr.com/db_cgi.txt
www.zeinelomr.com/default_cfg.txt
www.zeinelomr.com/html_pl.txt

If something wron in them please let me know, thanks for your help....

Ahmad
Quote Reply
Re: [flancer] Upload Mod: Internal Error In reply to
In your .cfg file you have the graphic filed defined in all caps. Unless you change this within all the coding for the mod, it's best you use "Graphic" as the instructions direct you to do.

There are some updates posted in the FAQ for the image upload mods. Below are some of the changes you may want to make:

In your db.cgi file sub validate_upload

Change: $file_test = $in{$db_key} . ".";
if ($file =~ /^$file_test/) {

to: $file_test = $rec{$db_key};
if ($file =~ /^$file_test\./) {

In sub delete_records:

change: $file_test = $data[$db_key_pos] . ".";

to: $file_test = $rec{$db_key};

In your html.pl file you have the coding outside the page contents in sub html_record. I think that is probably what is causing your error as there is a ending print tag prior to an open print tag.

Try using:

print qq|
<table width="607" border="1" align="center">
<tr bgcolor="#CCCCCC">
<td><$font_color>Mould Name:</td>
<td><$font_color>Design Name:</td><td><$font_color>Size:</td><td><$font_color>Mould Number:</td>
<td><$font_color>Photo:</td> </tr>
<tr> <td><$font>$rec{'mouldname'}</td>
<td><$font>$rec{'designname'}</td>
<td><$font>$rec{'size'}</td>
<td><$font>$rec{'mouldno'}</td>
<td><$font>$rec{'photo'}</td> </tr>
<TR><TD colspan=5>
|; # to close off a previous print qq| statement
opendir (GRAPHIC, "$SAVE_DIRECTORY") or &cgierr("unable to open directory in delete records: $SAVE_DIRECTORY. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
$file_test = $rec{$db_key};
foreach $file (@files) {
if ($file =~ /^$file_test\./) {
print qq|<img src= "$SAVE_DIRECTORY_URL/$file">|;
$graphic_found=1;
}
}
print qq| </TD></TR></table> |;

Hopefully these changes will get you up and running again. Be sure to adjust your database for the additional fields you added with the mod.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Upload Mod: Internal Error In reply to
thank you LoisC,

It works & running now.....really you are good expert...thanks to have a look on the script....you may have look into it how it works : www.zeinelomr.com/cgi-bin/dbman/db.cgi

Ahmad
Quote Reply
Re: [flancer] Upload Mod: Internal Error In reply to
Ahmad:

Glad you got it all working :) It looks very nice :)

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Upload Mod: Internal Error In reply to
Hi, again....

I have a problem in modifying a record, where I want to modify an image but, the old image it stay & comes another image near it....

I have found this script & I try it but it didn't works at all...

This is the script that I found it:

In sub validate_upload, try changing

$file_test = $in{$db_key} . ''.'';
foreach $file (@files) {
if ($file =~ /^$file_test/) {
unlink (''$SAVE_DIRECTORY/$file'');
}
}

to

foreach $file (@files) {
if ($file =~ /^$in{$db_key}\./) {
unlink (''$SAVE_DIRECTORY/$file'');
}
}


Is there something wrong in this script?

You may checkup by modifing any record in my Database that I setup it at URL:

http://www.zeinelomr.com/cgi-bin/dbman/db.cgi

thank you

Ahmad
In Reply To:
Ahmad:

Glad you got it all working :) It looks very nice :)
Quote Reply
Re: [flancer] Upload Mod: Internal Error In reply to
In my notes for the single file upload in sub validate_upload I have:

opendir (GRAPHIC, "$SAVE_DIRECTORY") or &cgierr("unable to open directory in delete records: $SAVE_DIRECTORY. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
$file_test = $rec{$db_key};
foreach $file (@files) {
if ($file =~ /^$file_test/) {
unlink ("$SAVE_DIRECTORY/$file");
}
}
if (!open(OUTFILE, ">$SAVE_DIRECTORY\/$filename")) {
return "There was an error opening '$SAVE_DIRECTORY\/$filename' for Writing.\n";
}

Try changing by matching with what is above and see if that helps. With the single file upload it should automatically keep the current photo unless you browse to choose a new photo. But it should hold more than 1 photo with the single upload.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Upload Mod: Internal Error In reply to
Frown Hi again,

I have try it but it seems, it gives another problem, where it deletes the images from another records, when I try to modify the record of one of the image in record.... Unsure

what shall I do ?
Quote Reply
Re: [flancer] Upload Mod: Internal Error In reply to
First thing you should check is your database and make sure that after you added additional fields that you modified any existing database records to include the new fields.

What I do is open the .db file in Excel and check to be sure the data is displaying in the correct fields. I don't actually make any changes within excel, but rather use my text editor.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/