in reply to Viewing .dat files

Kathy181249s there a way to have a link on an html page that will display the contents of the .dat file in plain text?

As the other answers suggest, you have to
write a 'reader program' which is stored some-
where and is accessible via /cgi-bin/ (in your case).

The file could roughly look like:
#!/usr/bin/perl # [plain] (no extension) # dump some /cgi-bin/ (or other) file in plaintext mode # 1) file must be in the same dir as script # 2) server has to provide PATH_INFO # 3) call with: http://my.server.org/cgi-bin/plain/textfile.dat # if 'plain' is the scripts name # my ($fn) = $ENV{SCRIPT_FILENAME} =~ /(.+?)[^\/]+$/g; $fn .= $1 if $ENV{PATH_INFO} =~ /([^\/]+)$/; print "Content-type: text/plain\n\n"; if( -f $fn ) { open my $fh, '<', $fn or warn "$!"; local $/; print <$fh> } else { print "($fn not found)\n" }
As shown above, you name this snippet eg. "plain" and invoke it by
    http://my.server.org/cgi-bin/plain/textfile.dat
(It uses the PATH_INFO Environment variable.)

Remember to get the access and user rights correct
when saving your stuff in /cgi-bin/

Regards

mwa