Ok; this worked for me:
sub {
my ($rec) = @_;
my $id = $rec->{ID};
if ($rec->{File1}) {
my $links_db = $DB->table('Links');
my $fh = $links_db->file_info( 'File1', $id );
my $location = $fh->File_RelativePath;
if ($fh->File_Name =~ /\.(jpg|gif)$/) {
return qq~ <img src="/imgup$location"> ~;
}
else {
return "Invalid file name.";
}
}
else {return "";}
}
Robert
Code:
sub {
my ($rec) = @_;
my $id = $rec->{ID};
if ($rec->{File1}) {
my $links_db = $DB->table('Links');
my $fh = $links_db->file_info( 'File1', $id );
my $location = $fh->File_RelativePath;
if ($fh->File_Name =~ /\.(jpg|gif)$/) {
return qq~ <img src="/imgup$location"> ~;
}
else {
return "Invalid file name.";
}
}
else {return "";}
}
Robert