首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

急struts2 下传 .mdb 数据库 出错

2012-09-23 
急!struts2 上传 .mdb 数据库 出错项目中需要上传 access 数据库文件到 指定的目录中用的struts2 上传 但

急!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;
}

[解决办法]
文件太大把!没设置!
[解决办法]
报错代码呢? 貌似有上传文件大小限制

热点排行