Gossamer Forum
Home : Products : DBMan : Customization :

file upload mod error

Quote Reply
file upload mod error
I tried your multiple file upload mod but got an error when i ran the script.

"DBMan encountered an internal error. Please enable debugging to view."

I have checked the syntax and everything. I cant even run db.cgi

Please help.
Quote Reply
Re: [tsrswebmaster] file upload mod error In reply to
Please be sure in your db.cgi sub delete_records

You followed this directions carefully.

# IMPORTANT!!!! Do *not* delete the } which follows the line
# ($output .= $line . "\n");
# in the subroutine. If you get a syntax error, the first place you should look is to be sure you have not removed the bracket.

If that does not solve you problem, please make a text copy of your html.pl and db.cgi files and provide the url where they can be viewed.

Sometimes an extra set of eyes helps to find the problem.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: u can view the filez In reply to
u can view the html.pl and db.cgi n default.cfg files at http://www.freewebz.com/tsrs/db.txt

http://www.freewebz.com/tsrs/html.txt

http://www.freewebz.com/tsrs/default.txt

pl.let me know wot the problem is.

thanx a lot.

tsrswebmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
In sub html_record

You are missing some closing and opening print tags:

Change:

<TD>&nbsp;<$font>$rec{'Assignment'}</TD></TR>

to:

<TD>&nbsp;<$font>$rec{'Assignment'}</TD></TR> |;


Change:

<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Deadline:</TD>

to:

print qq|<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Deadline:</TD>

I didn't look any further at your files, let me know if that fixed the error.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] u can view the filez In reply to
I changed wot u had said. still gives the same error.

"DBMan encountered an internal error. Please enable debugging to view."

pl. help.
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
In your db.cgi file sub delete records, as I mentioned above you have to check that you entered this correctly, it looks like you have mismatched brackets.

Try using:

######### change for file upload mod ###########
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) {
if (-e "$SAVE_DIRECTORY/$data[$db_key_pos]") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$data[$db_key_pos]") or &cgierr("unable to open directory in delete records: $SAVE_DIRECTORY/$data[$db_key_pos]. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
foreach $file (@files) {
unlink ("$SAVE_DIRECTORY/$data[$db_key_pos]/$file");
}
rmdir "$SAVE_DIRECTORY/$data[$db_key_pos]";
}
}
}
else { $output .= $line . "\n";
}
########## end multiple file upload lines
}

foreach $key (keys %delete_list) {

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] u can view the filez In reply to
Sorry to bother u again but the problem persists. same error.

u can check the new db.txt(conv. from new db.cgi) at the same address given earlier.

TSRS Webmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
In your .cfg file move:

$db_debug = 1;

to up above the section:

# File and URL's

also try moving the section: # File upload parameters
to right AFTER the # Authorization Options section right after:

$auth_logoff = "http://tsrscampus.port5.com/cgi-bin/dbman/db.cgi";

P.S. you might want to change your logoff to a static page.

Are you able to view your host's error log to see what could be happening? If not, then in the FAQ under troubleshooting there is a snippet of code you can add to your files which will give you more readable error messages.

The thread is called "Debugging - How To Obtain Useful Error Messages"

You did upload the corrections to your html.pl file correct?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] u can view the filez In reply to
tried evrything u said didnt work same error

also i cant find the debugging script in faq. pl give me the link.

TSRS Webmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
A direct link will not work as you have to login to the FAQ to view the database.

Once you login do a keyword search for record 971. Or choose the category "Troubleshooting" and it should be the first viewable record.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] u can view the filez In reply to
should i upload files in ascii or binary ? Maybe the prob. could be in upl;oading.

TSRS Webmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
i got the fault. it was in html.pl . i did some rollback to my old db )without upload mod) and it gave the same error (with auto_gen off)

so there then i fixed it and it ran(without upload mod as yet) . but now the prob. is that when the add page comes, in the dropdown fields it gives the errors :

" Error building select field: no select fields specified in config for field 'Type'! "

and therf. i cant add anything . same happens in modifying n deleting but surprisingly not in searching or viewing !! pl.help

Thanx.

TSRS Webmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
hey evrything seems to work now. except 1 thing

in the upload mod when i try to add record it gives error :

There were problems with the following fields: The directory doesn't exist. Make sure that this directory is a complete path name,
not a URL or something similar. It should look similar to
/home/username/public_html/uploads


though i hav set the paths correctly. tell me something

my path to dbman is http://tsrscampus.port5.com/cgi-bin/dbman/

and absolute path is host/t/s/r/p/o/r/tsrscampus.port5.com/cgi-bin/dbman

i hav got uploads direcrtory in dbman directory and outside cgi-bin.

wot should be the path then ?

Thanx.

TSRS Webmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
The path in your .cfg file looks okay:

$SAVE_DIRECTORY = "host/t/s/r/p/o/r/tsrscampus.port5.com/uploads";

Just make sure you set the permissions 777 for the uploads directory.

All the files should be uploaded in ASCII, unless you are uploading graphics.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] u can view the filez In reply to
Everything is working just fine now. I had not put a slash before 'host' in the path earlier. Actually I wanted the upload mod for a slightly dif. purpose. I wanted teachers to upload a doc file (word document) which would be the assignment for studets to download. I do not want them to upload a picture. So can u tell me what i should do in order to display a link (instead of the pic) to the doc file, in the viewing pages so that students can download it by clicking on the link.

Sorry to bother u so much . Thanx for evrything.

TSRS Webmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
Please check the FAQ under the section "Images" as you will find information on how to do what you want.

It's a great resource to find tips and tricks for customizing your database :)

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] u can view the filez In reply to
Sorry to bother u again but i just couldnt find the images under faq(of dbman). pl. help as to what to do to solve my problem.

TSRS Webmaster
Quote Reply
Re: [tsrswebmaster] u can view the filez In reply to
Look for this and change the extensions to match what you want (pdf, doc, wpd, etc.) - check the original MOD instructions to find out where you put it and in which file.

Code:
$ALLOWED_EXT = '\.gif$|\.jpg$|\.GIF$|\.JPG$';

Then find this bit and change it to a URL

Code:
<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}/$file">

example:
Code:
<A HREF= "$SAVE_DIRECTORY_URL/$rec{$db_key}/$file">$file</A>


I've never used the multi file upload mod, but I did have a copy so this is where I got the above stuff. Try it and see if it works. Have not tested it or spent any time looking at it. Good luck!
Quote Reply
Re: [Watts] u can view the filez In reply to
evrything working absolutely fine. just the way i wanted it.

thanx for evrything LoisC .

TSRS Webmaster