- print "Content-Type: $contentType\n";
- print "Content-Transfer-Encoding: binary\n";
- print "Content-Disposition: attachment; filename=\"$fileName\"\n\n";
+
+ print "Content-Type: $contentType\r\n";
+ print "Content-Transfer-Encoding: binary\r\n";
+
+ if ( $ENV{HTTP_USER_AGENT} =~ /\bmsie\b/i
+ && $ENV{HTTP_USER_AGENT} !~ /\bopera\b/i ) {
+ #
+ # Convert to cp1252 for MS IE. TODO: find a way to get IE
+ # to accept UTF8 encoding. Firefox accepts inline encoding
+ # using the "=?UTF-8?B?base64?=" format, but IE doesn't.
+ #
+ from_to($fileName, "utf8", "cp1252")
+ if ( $Conf{ClientCharset} ne "" );
+ }
+ print "Content-Disposition: attachment; filename=\"$fileName\"\r\n\r\n";