The following reply was made to PR general/3322; it has been noted by GNATS.

From: "Robert Dickow" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: general/3322: server corrupting cgi output for octet-streams
Date: 01 Nov 98 09:54:14 -0800

 Correction to my PERL listing. I hastily clipped the text
 from my editor while working on it. Here is the latest
 experimental incarnation. It works, but still the file data
 is changed during transmission. I'm trying to trick Apache
 or whatever to send raw data.
 
 >--------------------------------------------------------
 #!\perl\bin\perl
 
 # This simple program sends a file over HTTP as a binary file.
 # Script by Bob Dickow
 
 require "cgi-lib.pl";
 
 MAIN:
 {
    &ReadParse;
    $filename = "nwhsforms/" . $in{FILETYPE};
    unless (open(INFILE, $filename)) {
      exit;
    }
    print STDOUT &MyPrintHeader($in{FILETYPE});
 
    $c = getc(INFILE);
    while (eof(INFILE) == 0) {
      print STDOUT $c;
      $c = getc(INFILE);
    }
 }
 
 sub MyPrintHeader {
   $file = @_;
   $msg = "Content-Transfer-Encoding: binary\n";
   $msg = $msg . "Content-Type: application/octet-stream; name=" . $file . 
"\n\n";
   return $msg;
 }
 
 >-------------------------------------------------
 
 >Bob Dickow ([EMAIL PROTECTED])
 
 
 ***********************************************//*
 *       Bob Dickow  ([EMAIL PROTECTED])     \\// *
 * Associate Professor of Horn/Theory/Composition *
 *  Lionel Hampton School of Music/Univ of Idaho  *
 *     URL:   http://www.uidaho.edu/~dickow/      *
 **************************************************
 

Reply via email to