Gossamer Forum
Home : Products : DBMan : Customization :

Problem with file upload and display

Quote Reply
Problem with file upload and display
I just added the file upload mod from JPDeni's mod listings. I used the options NOT to force users to add a graphic on add, did NOT use the option to search records only containing graphics and DID use the option to display a default graphic.

My problem occurs to be something with the $db_key. I uploaded a graphic for record 41 and it also displays for record 4. The default graphic appears normally on all other records. Looking at default.db, all looks to be in order. The field "Filename" is only filled in record 41. The "Record" field that I use as the $db_key seems to be in order with no duplications. The graphic saved in the proper directory and with the proper filename "41.jpg".

All other fields in record 4 are displaying properly except for the fact that the graphic for record 41 is being displayed instead of my default graphic.

Some added info would be that I also use the User Friendly Short/Long display.
Quote Reply
Re: [jeffa] Problem with file upload and display In reply to
As a further note, I use the following code to display the picture in the proper table cell.



<td rowspan="7" BGCOLOR="green">|; # 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|
|;
unless ($graphic_found) {
print qq|<img src="http://www.eqwolf.com/dbpics/nopic.jpg">|;
}
Quote Reply
Re: [jeffa] Problem with file upload and display In reply to
Please check the FAQ noted below under the section "Images" for the latest fixes for the upload mod.

There is also a thread which related to the problem with you stated and may also be due to the latest updates not being used within your version of the mod.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Problem with file upload and display In reply to
Check out this thread reference:


Thread: http://gossamer-threads.com/p/92677
Subject: File Upload Problems
RBilger - 7-Jul-00

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/