MolSlide Support Project at bioinformatics.org
The MolSlide Support Project offers a tiny CGI program that enables
Protein Explorer (PE)
to save MolSlides to the local client disk, using PE's built-in MolSlide Manager. For further
information, see MolSlides.Org.
The official project page at bioinformatics.org is
Eric Martz (emartz AT microbio DOT umass DOT edu)
Timothy Driscoll (tim AT molvisions DOT com)
The source code for MolSlide Support is listed below.
This code is copyright © 2005 by Timothy Driscoll, www.molvisions.com.
No restrictions are placed on use of this code, but if you use it, please
acknowledge the author.
The following characters that may occur in tosubmit are escaped as follows.
This was determined to be the minimal set compatible with the submission
tosubmit = tosubmit.replace(/%/g, "%25");
tosubmit = tosubmit.replace(/\"/g, "%22")
tosubmit = tosubmit.replace(/&/g, "%26");
tosubmit = tosubmit.replace(/</g, "%3C");
tosubmit = tosubmit.replace(/>/g, "%3E");
The following is used to submit it to the CGI program.
<form name="saveForm" id="saveForm"
writeln("<input name=\"molslide1\" id=\"molslide1\"");
writeln("value=\"" + tosubmit + "\"");
<input value="Save MolSlides via Bioinformatics.Org" type="submit">
The CGI program writes nothing to the server's disk. It always returns the file to be saved
to the same IP address that submitted the data. Were malicious data to be
submitted, they would simply be returned to the submitter.
#! /usr/bin/perl -wT
use CGI::Carp qw( fatalsToBrowser );
$CGI::POST_MAX = 1024 * 2000;
my $error_message = shift;
my $qe = new CGI;
print $qe->start_html( "Error" ),
$qe->h1( "Error" ),
$qe->p( "the following error has occured: " ),
$qe->p( $qe->i( $error_message ) ),
CGI::Carp::set_message( \&carp_error );
my $q = new CGI;
my( $name, $value );
print $q->header( -type=>'application/force-download',
foreach $name ( $q->param )
foreach $value ( $q->param ( $name ) )
$value =~ s/%22/"/gi;
$value =~ s/%26/&/gi;
$value =~ s/%3C/</gi;
$value =~ s/%3E/>/gi;
# safest to do % last!
$value =~ s/%25/%/gi;