81,091
社区成员
发帖
与我相关
我的任务
分享
String path=ServletActionContext.getServletContext().getRealPath("/fileDir");
path=path+fileName;
System.out.println(myFile);
try {
BufferedInputStream input=new BufferedInputStream(new FileInputStream(myFile),2048);
BufferedOutputStream output=new BufferedOutputStream(new FileOutputStream(new File(path)),2048);
byte [] b=new byte[2048];
while(input.read(b)>1){
output.write(b);
b=new byte[2048];
}
input.close();
output.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}