Gossamer Forum
Home : Products : DBMan : Customization :

Displaying external text files

Quote Reply
Displaying external text files
I'm wondering if this is possible with DB Man....


The database contains a variety of fields including one for GIFs and one for text files (*.txt). I want to display the contents of the text files in conjunction with the other data but can't figure out if this is even possible.

The reason we want to do this is to avoid having to break them up into 254 character database fields. The longest text file is approx. 3500 characters long.

Thank you!

[This message has been edited by Cathy K (edited December 08, 1999).]
Quote Reply
Re: Displaying external text files In reply to
Hi Cathy K

Hope I'm not out of line here. I don't have the answer to your DBMan question, but if you use Access, try defining the field as memo instead of text to get around the character limitation.
Quote Reply
Re: Displaying external text files In reply to
Absolutely possible... even will take HTML formatting. I have a DB where the only fields are: ID, Date, Author (User), Title and URL. Using the short/long modifcation by Carol, the short provides a "directory listing" of what's in the DB so that a user can search by date, author, etc. The long prints out the file indicated by the URL. Here is the entirety of my html_record_long
sub html_record_long {
my (%rec) = @_;
$page_title = $rec{'Title'};
open (FILE, "/path/to/root/private_html/$rec{'URL'}") | | &cgidie ("Couldn't open the file $rec{'URL'}");
@lines = <FILE>;
close (FILE);
foreach $line (@lines) {
$line =~ s/%%uid%%/$db_uid/g; #substitutes the current $db_uid in external text/HTML file for %%uid%%
$page .= "$line";
print $page;


[This message has been edited by oldmoney (edited December 11, 1999).]