-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3744266
By: joken2006
Media media = (Media) Fileupload.get();
InputStream ipuStm = (InputStream)media.getStreamData();
String outfn = "d:\\netdisk\\zktest\\a.jpg";
try {
FileOutputStream output = new FileOutputStream(outfn);
byte[] buf = new byte[1024];
int count;
count = ipuStm.read(buf, 0, 1);
while(count!=-1){
output.write(buf,0,count);
count = ipuStm.read(buf,0,count);
}
output.flush();
ipuStm.close();
output.close();
System.out.println("File copy sucessfully!");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Asked: 2006-05-22 10:51:48 +0800
Seen: 437 times
Last updated: Apr 23 '11