Gossamer Forum
Home : Products : DBMan SQL : Discussion :

file_upload mod ..delete problem...

Quote Reply
file_upload mod ..delete problem...
Hi all....
I'm still working on converting JPDeni 's "file_upload mod" to Dbsql...
all is working fine except when I delete a record..the code below will not delete the corresponding graphic...
I've tried numerous alterations to the code but no success....can anyone assist??? thanks Rob

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


Subject Author Views Date
Thread file_upload mod ..delete problem... Rob 2680 Dec 31, 2000, 2:05 PM
Thread Re: file_upload mod ..delete problem...
Rob 2690 Dec 31, 2000, 5:25 PM
Post Re: file_upload mod ..delete problem...
Stealth 2647 Dec 31, 2000, 5:34 PM
Thread Re: file_upload mod ..delete problem...
TheFox 2637 Dec 31, 2000, 5:56 PM
Post Re: file_upload mod ..delete problem...
Rob 2637 Dec 31, 2000, 7:27 PM
Post Re: file_upload mod ..delete problem...
jai 2551 Apr 7, 2001, 5:33 PM
Post Re: file_upload mod ..delete problem...
gatman 2547 Apr 16, 2001, 10:44 AM