用dsoframer控件POST了一个word文档到JSP页面,JSP页面怎么接收然后写成一个WORD文档啊

来源:百度知道 编辑:UC知道 时间:2024/05/27 02:46:43
最好给个接受Request中的数据 然后写成文件的例子
Dsoframer上传接口将数据流以Http方式提交到保存页面,现在可以保存在服务器上了,但是保存后是乱码...谁帮忙看看为什么是乱码?
保存代码:
boolean res = false;
byte[] buffer;
int bufLen;
int totalRead = 0;
FileOutputStream fos = null;
bufLen = request.getContentLength();
buffer = new byte[bufLen];
File file = new File("E:\\tomcat5\\webapps\\WebEditor\\doc\\aa.doc");
if (!file.exists()) {
file.createNewFile();
}
totalRead = request.getInputStream().read(buffer);
if (totalRead != -1) {
fos = new FileOutputStream(file);
fos.write(buffer);
fos.flush();
}

这些问题,可不好回答哦,还是去找些相关的资料查查吧,百度一下试试,

我只能祝你好运啰...

你好,想问一下你的这个乱码的问题解决了吗?解决了的话能否说说怎么解决的?