81,091
社区成员
发帖
与我相关
我的任务
分享
//调用struts 的FormFile
FormFile formFile=userPhotoForm.getPhoto();
//取出输入流
InputStream is=null;
OutputStream os=newFileOutputStream(文件路径+"\\"+文件名);
try{
is=formFile.getInputStream();
int leng=0;
byte []bytes=new byte[1024];
//循环处理
while((leng=is.read(bytes))>0){
os.write(bytes, 0, leng);
}
catch(Exception e){
e.printStackTrace();
}
大概就是这样吧,我也就复习一下。
我大学还没毕业。 没你说的三年工作经验。。