查看完整版本: [10-26] 解決dz4.1UTF附件中文名下載亂碼問題

rengo 2006-10-26 07:48

[10-26] 解決dz4.1UTF附件中文名下載亂碼問題

打開attachment.php

查找

[code]        $filesize = filesize($filename);

        ob_end_clean();
        header('Cache-control: max-age=31536000');
        header('Expires: '.gmdate('D, d M Y H:i:s', $timestamp + 31536000).' GMT');
        header('Content-Encoding: none');
        //header('Content-Length: '.$filesize);

        //forbid flash be opened directly
        //header('Content-Disposition: '.(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'inline; ' : 'attachment; ').'filename='.$attach['filename']);

        header('Content-Disposition: attachment; filename='.$attach['filename']);
        header('Content-Type: '.$attach['filetype']);
}[/code]

覆蓋成

[code]$filesize = filesize($filename);

        ob_end_clean();
        header('Cache-control: max-age=31536000');
        header('Expires: '.gmdate('D, d M Y H:i:s', $timestamp + 31536000).' GMT');
        header('Content-Encoding: none');
        $attach['filename'] = (strtolower($charset) == 'utf-8' && strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? urlencode($attach['filename']) : $attach['filename'];

        if($isimage && !empty($noupdate)) {
                header('Content-Disposition: inline; filename='.$attach['filename']);
        } else {
                header('Content-Disposition: attachment; filename='.$attach['filename']);
        }
        header('Content-Type: '.$attach['filetype']);[/code]

[color=#ff0036]後台更新緩存[/color]~完成
頁: [1]
查看完整版本: [10-26] 解決dz4.1UTF附件中文名下載亂碼問題