最近正在做一个视频上传的作业,代码如下:(用main测试的时候可以复制完整复制视频文件,但是用struts2进行上传操作的时候,只能上传。txt,doc,ppt这些文件,就是上传不了视频avi,wmv等)这些文件,找了好多不知道问题出在哪儿?求大神指点!
public void readFileByBytes(String src,String dec)  {
try{
File fi = new File(src);
File fo = new File(dec);
if(!fi.exists()){
return;
}
if(!fo.exists()){
fo.createNewFile();
} FileInputStream fis = new FileInputStream(fi);
FileOutputStream fos = new FileOutputStream(fo); byte[] b = new byte[1024000];
int n;
while ((n = fis.read(b)) != -1) {
fos.write(b, 0, n);
System.out.println(n);
}
fis.close();
fos.close();
}catch(Exception e){
e.printStackTrace();
} }jspfileexceptionstringstruts