jsp上传组件 jspsmartupload就可以了。
解决方案 »
- 我tomcat和eclipse helios已经装好了 但是还是无法运行JSP文件
- websphere部署应用为什么那么慢
- js怎么判断后台传的结果集是空 急
- TreeSet取值问题?
- WEBlogic8中jdbc连接池的配置问题?
- 数据库连接问题。我按照书本上提供的例子做了一个EJB。其中数据连接通过实体Bean。在创建EJB的机子上运行正常,但我在另外一台机子上配置
- 一个类里面用两个数据库连接的问题,巨奇怪!!!
- 恶心微软的MVP在网上大放撅词。
- 求救一个EJB例子
- jbuilder 8 的注册机?
- struts中有没有多个Action对应用一个ActionForm,或是多个ActionForm对应用一个Action
- JAVA 调用 .NET写的WEB SERVICE的问题(包括无法传递参数,SOAP头验证)
To:terry_yip
呵呵,一定记得结帖,但是现在还没有解决问题呀。
URL的具体实现怎么做啊,我想用URLConnection传递对象,而服务器端用servlet接受处理这个请求。
传输文件的话你可以试试COS,这个组件传输的过程中不会有问题。
另外,你的http-socket能否成功?
boolean flag = false;
try {
InputStream stream = file.getInputStream(); // 把文件读入
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStream bos = new FileOutputStream(filePath + "/"
+ file.getFileName()); // 建立一个上传文件的输出流
// System.out.println(filePath+"/"+file.getFileName());
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
baos.write(buffer, 0, bytesRead); // 将文件写入服务器
}
bos.close();
stream.close();
flag = true;
} catch (Exception e) {
System.err.print(e);
}
return flag;
}
文件上传后损坏。。xls doc ,bmp等都是
只有txt是好的
用的是fileupload和smartupload。都不行