Author Topic: downloading attachment has bug on Korean  (Read 2640 times)

Offline jshan

  • Newbie
  • *
  • Posts: 3
downloading attachment has bug on Korean
« on: April 21, 2008, 10:57:18 PM »
Hi there.

I have a problem downloading attachments which includes Korean letters. All letters(Korean) for attachments are broken. So, I made a workaround. ( I referred to the SquirrelMail )

program/steps/mail/get.inc 109 lines
// IF NEW
//      print_r($part);
//      exit;
      if (!ini_get('safe_mode')) {
         set_time_limit(0);
      }
      $isIE = false;
      $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
      if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
            strstr($HTTP_USER_AGENT, 'Opera') === false) {
         $isIE = true;
      }
      $ie_filename = $isIE ? rawurlencode($part->filename):$part->filename;
      //set the inline header for IE, we'll add the attachment header later if we need it
//      header ("Content-Disposition: inline; filename=$ie_filename");
//      header ("Content-Type: application/octet-stream; name=\"$ie_filename\"");
//      header ("Content-Disposition: attachment; filename=\"$ie_filename\"");
//      header ("Content-Type: application/force-download; name=\"$ie_filename\"");

      if($_GET['_download'])
         header ("Content-Disposition: attachment; filename=\"$ie_filename\"");
      else
         header ("Content-Disposition: inline; filename=$ie_filename");

      if($part->size > 0) {
         header("Content-Length: $part->size");
      }

// ELSE
/*
   header(sprintf('Content-Disposition: %s; filename="%s";',
           $_GET['_download'] ? 'attachment' : 'inline',
           $part->filename ? abbreviate_string($part->filename, 55) : "roundcube.$ctype_secondary"));
*/
// ENDIF