www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Dickow" <dic...@uidaho.edu>
Subject Re: general/3322: server corrupting cgi output for octet-streams
Date Sun, 01 Nov 1998 17:30:01 GMT
The following reply was made to PR general/3322; it has been noted by GNATS.

From: "Robert Dickow" <dickow@uidaho.edu>
To: marc@apache.org
Cc: apbugs@apache.org
Subject: Re: general/3322: server corrupting cgi output for octet-streams
Date: 01 Nov 98 09:24:48 -0800

 >First, please tell us what Apache version you are using.
 >"2.0" doesn't exist.  It is very hard to help you when you
 >do not include valid information in your PR!
 
 Oh. No wonder things aren't going right for me! ;-) It turns
 out it is version 1.3.2
 
 >Second, what language is your CGI script in?  How is it sending
 >it?  Give an example.
 
 Here is my PERL script. Maybe I need to put some other MIME
 header information in there?
 
 --------------------------------------------------------
 #!\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 {
   return "Content-Type: application/octet-stream; name="\n\n";
 }
 
 -------------------------------------------------
 
 Bob Dickow (dickow@uidaho.edu)
 

Mime
View raw message