]> bicyclesonthemoon.info Git - ott/bsta/blobdiff - attach.1.pl
character encoding information in generated headers; password in eval_bb()
[ott/bsta] / attach.1.pl
index 226714f42dd2c9be034d29ebef562968dbb4b8a6..f2a124a0ca12ce92434d4d918f2e63630ea7d912 100644 (file)
@@ -106,8 +106,6 @@ if ($method eq 'POST') {
        }
 }
 
-# print "content-type: text/plain\n\n";
-
 $ID       = get_id(      \%cgi);
 $password = get_password(\%cgi);
 
@@ -170,8 +168,12 @@ else {
                print 'Content-length: '.$file_info[7]."\n";
        }
 }
-print 'Content-type: '.$file_data{'content-type'}."\n";
-print 'Content-disposition: attachment; filename="'.$file_name.'"'."\n";
+if ($file_data{'content-type'} ne '') {
+       print 'Content-type: '.$file_data{'content-type'}."\n";
+}
+if ($file_name ne '') {
+       print 'Content-disposition: inline; filename="'.$file_name.'"'."\n";
+}
 unless ($direct) {
        unless (binmode STDOUT) {
                close($fh);