链接excel、word文件出现乱码,哪位高手能解决?

jaliu 2004-09-08 04:21:15
代码:
<html>
<head>
<title>值班日志审核</title>
</head>
<body>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<tr align="center">
<td>值班人</td>
<td>手机号码</td>
<td>上传时间</td>
<td><a href="asdf.xls">日志</a></td>
</tr>
</table>
</body>
</html>

直接用IE打开,没有问题;但是打开tomcat 后,用http://localhost/test.html 确打不开。出现乱码,郁闷……不解……请高手解答
...全文
270 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zealVampire 2004-09-11
  • 打赏
  • 举报
回复
呵呵你可以这样的啊
如果是联接word的就response.setContent(对应的头)....ms-word+编码。。。
excel就reponse.setContent...content="application/vnd.ms-excel +编码方式gbk( 具体忘记了)
lakesea 2004-09-11
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/2636/2636845.xml?temp=.399975

看看这个,这个是tomcat下解决这个问题的办法,不知道你用的什么web服务器,所以只能提示一下


我的信誉分不代表我的信誉!
lakesea 2004-09-11
  • 打赏
  • 举报
回复
该配置文件
不知道你用的什么web服务器?
pirloxiao 2004-09-11
  • 打赏
  • 举报
回复
<a href="http://localhost/asdf.xls">
试一下!
jaliu 2004-09-08
  • 打赏
  • 举报
回复
不行!
而且改了content="application/vnd.ms-excel;"之后test.html页变成excel格式,但是链接过去后还是乱码。
xiuluo2305 2004-09-08
  • 打赏
  • 举报
回复
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
看看行不

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧