Gossamer Forum
Home : Products : DBMan : Customization :

IMAGE UPLOAD...AAAArrgghhh

Quote Reply
IMAGE UPLOAD...AAAArrgghhh
Hello board,

Please, please, please can somebody help me here. I have tried for days and days to install the simple (single) image upload mod to the dbman script but cannot get it working.

I have the original script working fine and have changed all the necessary variables/additions to the script as per the instructions (I think) but still no luck. I have enabled debugging but simply get the message 'enclountered internal error, enable debugging'. I have done this but no further error messages appear?

Is there any way I can get the necessary files already modified so all I have to do is change the url's/paths to my files/folders??

I really hope somebody can help me here, this is a great script and i'm hust one step away from total happiness.

Thank you all in advance. :)

Quote Reply
Re: IMAGE UPLOAD...AAAArrgghhh In reply to
Could you please post a .txt copy of your files on your server and perhaps we can spot where the error is occuring.

You must save the files as .txt so they can be viewed, then post the full url to access the files.

It could just simply be a misplaced bracket. Also in the FAQ noted below under "Troubleshooting" there is a great little mod for displaying more useful error messages.



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: IMAGE UPLOAD...AAAArrgghhh In reply to
Hello there,

Thank you for replying to my thread, as requested I have uploaded the files in txt format which can be viewed here:

http://www.sportingwales.f2s.com/default.txt
http://www.sportingwales.f2s.com/html.txt
http://www.sportingwales.f2s.com/db.txt

I have been trying all day to find the problem still to no avail. Thank you in advnce if you are able to help and thanks for your time in trying to help.

:)


Quote Reply
Re: IMAGE UPLOAD...AAAArrgghhh In reply to
In your .cfg file I noticed you don't have a field called "Filename".

In your sub html_record_form you have:

if ($form_upload) {
print qq|
<TR><TD>Browse Picture:</TD>
<TD><INPUT TYPE="FILE" NAME="Graphic" SIZE="50"></TD></TR>|;
}

This should be:

|;
if ($form_upload) {
print qq|
<TR><TD>Browse Picture:</TD><TD><INPUT TYPE="FILE" NAME="Filename" SIZE="50"></TD></TR>|;
}

In your sub html_record you have:

|; # 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;
}
}

and this is above rather than within your table for the page layout. This is different than the instructions for the single file upload mod.

It should look like this for that mod:

|; # to close off a previous print qq| statement
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
GRAPHIC: foreach $extension (@extensions) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">|;
$graphic_found=1;
last GRAPHIC;
}
}

I think I should ask just to clarify which file upload mod you are using. Are you using:

### F I L E U P L O A D
### Last Modified: 29 Apr 2000
###
### Mod based on a script created by Jeff Carnahan jeffc@terminalp.com
### Adapted for use by DBMan by JPDeni deni@jpdeni.com
### Integration with DBMan script by Jim Kangosjärvi Jim.Kangosjarvi@Abc.se

I believe JP has made a new update recently to account for a few fixes but is this the version you are using?



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: IMAGE UPLOAD...AAAArrgghhh In reply to
Hello again,

Firstly, thank you for your time, I appreciate that their are many problems to solve and your time is very much appreciated.

To answer your questions, yes I am using the lastest mod from JP. I cannot find any note however of the following which you mention:

In your sub html_record you have:

|; # 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;
}
}

and this is above rather than within your table for the page layout. This is different than the instructions for the single file upload mod.

It should look like this for that mod:

|; # to close off a previous print qq| statement
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
GRAPHIC: foreach $extension (@extensions) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">|;
$graphic_found=1;
last GRAPHIC;
}
}

I have just checked the file for the single upload and this coding is not in there??

I have also changed all other code as per your instructions and moved the "qql" within the table, still to no avail.

Also I cannot get any information while debugging? I ahve tried both on and off? Any idea?

Thank you very much again for your time and help :)

Quote Reply
Re: IMAGE UPLOAD...AAAArrgghhh In reply to
Your best bet would be to follow the instructions again and be sure that you include everything the instructions tell you to do.

I didn't finish checking through your files to be sure all of the mod was installed. There were portions of code in your script that did not follow the instructions for the single image upload.

There many be more codes you need to add, or change within your files. Just take it step by step and be sure to do everything it states.

If you still have problems after that, save a new copy of your files with the changes made and state exactly what it is or is not doing.

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