当前位置: 代码迷 >> J2EE >> 急struts2 下传 .mdb 数据库 出错
  详细解决方案

急struts2 下传 .mdb 数据库 出错

热度:667   发布时间:2016-04-22 00:41:01.0
急!struts2 上传 .mdb 数据库 出错
项目中需要上传 access 数据库文件到 指定的目录中 用的struts2 上传 但是测试发现上传 .mdb 文件都不经过action处理 直接报错 应该是类型问题 ! (其他的一些类型 (exe/doc/img/rar的都可以)上传成功! ) 不知道 为什么 ? 求高手指点

这是上传Action代码

public String uploadAction(){
String root = ServletActionContext.getRequest().getRealPath("/access");

try {
is = new FileInputStream(file);
File destFile = new File(root,fileFileName);
os = new FileOutputStream(destFile);
byte [] buffer = new byte[400];
int length = 0;
while( -1 != (length = is.read(buffer))){
os.write(buffer,0,length);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
is.close();
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
return SUCCESS;
}

------解决方案--------------------
文件太大把!没设置!
------解决方案--------------------
报错代码呢? 貌似有上传文件大小限制
  相关解决方案