Gossamer Forum
Home : Products : DBMan : Customization :

Multiple File Upload Error

Quote Reply
Multiple File Upload Error
I'm having a problem with the JPDeni's multiple file upload mod. I installed it all I think correctly, but now I get an internal server error and I can't even access any of it. If you need me to post my files in text format let me know.

Quote Reply
Re: Multiple File Upload Error In reply to
Having recently worked with this mod, I'd be happy to take a look at your files if you could save them as text files and upload them to an area accessible via the web. You could post the url here or send me a private message (link at top of forum) with the url where the files can be viewed.

Quote Reply
Re: Multiple File Upload Error In reply to
Do you by any chance have debugging turned on in your .cfg file?

What might really help at this point also is to visit the FAQ noted below and under the section for "Troubleshooting" you will find a snippet of code in a thread called "Debugging - How To Obtain Useful Error Messages"

If you set this up for your .cgi, html.pl, and also your .cfg files you may be able to quickly pinpoint the error.

If not, the next step would be to go over the instructions for setting up the mod again and be sure you did not leave out anything. And also that you didn't remove any ending brackets or put them in the wrong place.

If you still have no luck, then you may have to make a .txt copy of your files so they can be viewed by others.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Multiple File Upload Error In reply to
That would be great if you could look at them. I tried your suggestions LoisC, but to no avail.

Here are the URLs:

1. http://www.cartooncommunity.com/db.txt
2. http://www.cartooncommunity.com/default.txt
3. http://www.cartooncommunity.com/html.txt

I think you can guess what they correspond to :D

Thanks a lot.


Quote Reply
Re: Multiple File Upload Error In reply to
 
In your default.cfg file, you need to make the following changes.

Add a comma at the end of this field:

Userid => [9, 'alpha', -2, 255, 0, '', '' ],

Add a checkbox configuration for "Graphic" (and remove the Popular)

%db_checkbox_fields = ( Graphic => 'Yes,No');

Remove the comma at the end of your Category list:

Horror,Furry,Animated,Other',

Comment out the radio button field:

# %db_radio_fields = ( Validated => 'Yes,No' );

Make sure you're setting the actual info in these variables:

# Full path to directory for uploaded files -- NOT A URL!!!! No trailing slash please.
$SAVE_DIRECTORY = "/home/username/public_html/uploads";

# Full URL to directory for uploaded files. No trailing slash please.
$SAVE_DIRECTORY_URL = "http://www.server.com/uploads";

Crazy Try those corrections and see how things work. If you're still having problems after the changes are made, save the default.cfg file and upload again then post a note in here.

Quote Reply
Re: Multiple File Upload Error In reply to
I tried the changes you said and it unfortunately didn't make a difference.

I'm definitely open to any other ideas...I wish JPDeni were around to look at my damn code :)

Quote Reply
Re: Multiple File Upload Error In reply to
Can you resave your default.cfg file as a text file and make available from the web so I can review the changes?

Quote Reply
Re: Multiple File Upload Error In reply to
Ok I reuploaded the default text file. <a href="http://www.cartooncommunity.com/default.txt">Here</a>.Thanks again.

Quote Reply
Re: Multiple File Upload Error In reply to
Did you install the debugging code? If so where did you place your error.txt file?
It could save hours of trying to figure out where a problem is within the script.

In your .cfg file:

%db_checkbox_fields = ( Graphic => 'Yes,No');

should be:

%db_checkbox_fields = ( Graphic => 'Yes' );

You did not follow directions for this:

# Full path to directory for uploaded files -- NOT A URL!!!! No trailing slash please.
$SAVE_DIRECTORY = "/web/artistpics/";

--------------------
# file: db.cgi
# sub delete_records

# 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.

It appears that you have removed that ending bracket which could be causing your problems.

----

That's as far as I got looking over your code, I think you really need to check over the instructions again, as that is what those helping you are having to do. It's so much easier to do this locally then having to open the files on the web.


Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Multiple File Upload Error In reply to
Thanks to your tips, I got it working, to some extent. Everything works and it adds the record, but then a few things happen. First, the file isn't actually uploaded to the ftp when I check, which is supposed to be the purpose of the mod :) Second, upon displaying the records, it mixes all the fields up, so it will move everything around, like your ID will be in the name field, etc.

Finally, there is no field in the record display to display the graphics that you supposedly upload, even though they don't ever get to the server. Oh, and when I tried searching for a record, it tried to put the image that i had uploaded above the search box, for some reason, but that didn't even show up because the image was never really uploaded. All kinds of problems...

Even though the debugging doesn't detect them.

Quote Reply
Re: Multiple File Upload Error In reply to
It sounds as though your database is corrupted.

When you added the extra fields:

Filename and Graphic to your .cfg file for the image upload mod, did you also add these fields to your existing database?

If you already had records added in your database and then added additional fields it will not run properly until you add those additional fields in your current database.

Also to see the debugging within your .cfg file you have to set:

$db_debug = 1;

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Multiple File Upload Error In reply to
See what you can make of the sub_html_record form...

sub html_record_form {
# --------------------------------------------------------
# The form fields that will be displayed each time a record is
# edited (including searching). You don't want to put the
# <FORM> and </FORM tags, merely the <INPUT> tags for each field.
# The values to be displayed are in %rec and should be incorporated
# into your form. You can use &build_select_field, &build_checkbox_field
# and &build_radio_field to generate the respective input boxes. Text and
# Textarea inputs can be inserted as is. If you turn on form auto
# generation, the program will build the forms for you (all though they may
# not be as nice). See the README for more info.

my (%rec) = @_;
$rec{$db_key} =~ s/<.?B>//g;

#($db_auto_generate and print &build_html_record_form(%rec) and return);

my $font = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';

print qq|
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">

<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font>ID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="ID" VALUE="$rec{'ID'}" SIZE="3" MAXLENGTH="3"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Name:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Name" VALUE="$rec{'Name'}" SIZE="40" MAXLENGTH="255"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Middle Initial: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="MiddleIni" VALUE="$rec{'MiddleIni'}" SIZE="40" MAXLENGTH="255"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Last Name: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="LastName" VALUE="$rec{'LastName'}" SIZE="40" MAXLENGTH="255"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Website: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="URL" VALUE="$rec{'URL'}" SIZE="40" MAXLENGTH="255"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>E-mail: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Email" VALUE="$rec{'Email'}" SIZE="40" MAXLENGTH="255"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Date:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Date" VALUE="$rec{'Date'}" SIZE="12" MAXLENGTH="12"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Category:</FONT></TD>
<TD VALIGN="TOP"> |; print &build_select_field ("Category", "$rec{'Category'}"); print qq|</TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Description:</FONT></TD>
<TD VALIGN="TOP"> <TEXTAREA NAME="Description" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Description'}</TEXTAREA></TD></TR>
### Wherever you want your graphics to print out, use the following:

if (-e "$SAVE_DIRECTORY/$rec{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$rec{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}/$file">|;
}
}
|;
if ($form_upload_add) {
print qq|<tr><td colspan=2>You may upload up to $MAXIMUM_FILES files, for a total of
$MAXIMUM_UPLOAD bytes.</td></tr>|;
for ($u=1;$u<=$MAXIMUM_FILES ;++$u) {
print qq|
<TR><TD>Browse Picture:</TD>
<TD><INPUT TYPE="FILE" NAME="file-to-upload-$u" SIZE="50"></TD></TR>|;
}
}
if ($form_upload_mod) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$rec{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
++$num_files;
@stats = stat "$SAVE_DIRECTORY/$rec{$db_key}/$file";
$prev_bytes +=$stats[7];
}
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
print qq|<tr><td>Delete file
<input type="checkbox" name="$file" value="delete"></td>
<td><img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}/$file"></td></tr>|;
}
}
$new_files=$MAXIMUM_FILES - $num_files;
$new_bytes=$MAXIMUM_UPLOAD - $prev_bytes;
print qq|<tr><td colspan=2>You currently have $num_files files associated with this record, for a
total of $prev_bytes bytes. You may upload up to $new_files additional files, with a total byte
size of $new_bytes bytes.</td></tr>|;
for ($u=1;$u<=$new_files ;++$u) {
print qq|
<TR><TD>Browse Picture:</TD>
<TD><INPUT TYPE="FILE" NAME="file-to-upload-$u" SIZE="50"></TD></TR>|;
}
}
print qq|

</TABLE>
|;
}

Quote Reply
Re: Multiple File Upload Error In reply to
You didn't state what the problem was so I'm not sure what problem you are having, but did notice you didn't end the print statement in the following lines:

<TD VALIGN="TOP"> <TEXTAREA NAME="Description" ROWS="4" COLS="40" WRAP="VIRTUAL"
MAXLENGTH="255">$rec{'Description'}</TEXTAREA></TD></TR>
### Wherever you want your graphics to print out, use the following:

should be:

<TD VALIGN="TOP"> <TEXTAREA NAME="Description" ROWS="4" COLS="40" WRAP="VIRTUAL"
MAXLENGTH="255">$rec{'Description'}</TEXTAREA></TD></TR> |;
### Wherever you want your graphics to print out, use the following:

This would cause problems.

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/