急!請大哥們幫個忙:struts上傳文件編碼問題!(若分不夠再加!) 我也想问这个问题,帮你顶一下阿 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有几个地方我需要确定一下:1.<form name="form2" method="post" action="uploadWarnSoundConf.do" enctype="multipart/form-data">在这里设置类型enctype;2.在bean中的获取并保存的方式:首先---private FormFile uploadFile;然后---String fname=uploadFile.getFileName();InputStream ins = uploadFile.getInputStream();OutputStream outs=new FileOutputStream(store_path+"/"+fname);int bytesRead=0;int size=uploadFile.getFileSize();byte[] buffer=new byte[size];while((bytesRead=ins.read(buffer,0,size))!=-1){ outs.write(buffer,0,bytesRead);}我用的是简体操作系统,这样应用没有碰到过乱码问题。 ajax向servlet传递参数问题 咨询两个问题的处理方式 图片上传问题 急求解! struts2中action里怎么判断数据库拿到的值和页面输入的值相不相等 本人学习POI 一个关于SSH的问题 正则表达式提取问题 关于blueprints 和 struts 两种waf,欢迎大家热烈发表看法. 关于线程 几个面试题,求解释 J2EE中使用DAO模式\JDBC驱动写成的数据访问层组件,能被C/C++业务逻辑组件调用吗? 那位用过struts的大哥帮小弟解决下STRUTS中的标签问题
1.<form name="form2" method="post" action="uploadWarnSoundConf.do" enctype="multipart/form-data">在这里设置类型enctype;
2.在bean中的获取并保存的方式:
首先---
private FormFile uploadFile;
然后---
String fname=uploadFile.getFileName();
InputStream ins = uploadFile.getInputStream();
OutputStream outs=new FileOutputStream(store_path+"/"+fname);
int bytesRead=0;
int size=uploadFile.getFileSize();
byte[] buffer=new byte[size];
while((bytesRead=ins.read(buffer,0,size))!=-1){
outs.write(buffer,0,bytesRead);
}
我用的是简体操作系统,这样应用没有碰到过乱码问题。