0

Why is it error?

asked 2006-05-22 10:51:48 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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();
}


delete flag offensive retag edit

11 Replies

Sort by ยป oldest newest

answered 2011-04-23 03:15:07 +0800

qfl gravatar image qfl
3

dgd

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-05-22 10:51:48 +0800

Seen: 437 times

Last updated: Apr 23 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More