-
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();
}
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3748487
By: tomyeh
Search the developer's guide for max-upload-size.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3747919
By: nobody
Thank you,The problem has been solved.
but i upload a file that size is bigger than 5M,It caus error:
the request was rejected because it's size exceeds allowed range
What should i do?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3747854
By: joken2006
Yes,it's right to get file size.
but when i upload a file (The File type isn't wma or jpg). the following error is encountered .is causing it. not sure why? thanks for the help.
--------------------------------------------------
13 2006-5-24 15:24:45 com.potix.zk.ui.sys.PageImpl interpret:416
a﹐¥e??: >>bsh.TargetError: Sourced file: inline evaluation of: `` {
filewin.upload(); } ;'' : Method Invocation filewin.upload
>>java.lang.IllegalStateException
>> at com.potix.util.media.AMedia.getByteData(AMedia.java:153)
>> at com.uit.netdisk.zk.fileOperate.FileManagerWindow.upload(FileManagerWindow.
java:407)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at bsh.Reflect.invokeMethod(Unknown Source)
>> at bsh.Reflect.invokeObjectMethod(Unknown Source)
12 2006-5-24 15:24:45 com.potix.zk.ui.sys.UiEngineImpl resumeAll:628
a﹐¥e??: Unable to resume [Event processing thread: event=null, ceased=false] java.lang.IllegalStateException
at com.potix.util.media.AMedia.getByteData(AMedia.java:153)
at com.uit.netdisk.zk.fileOperate.FileManagerWindow.upload(FileManagerWindow.ja
va:407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at bsh.Reflect.invokeMethod(Unknown Source)
at bsh.Reflect.invokeObjectMethod(Unknown Source)
at bsh.Name.invokeMethod(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at com.potix.zk.ui.sys.PageImpl.interpret(PageImpl.java:409)
at com.potix.zk.ui.sys.EventProcessingThread.process0(EventProcessingThread.jav
a:359)
at com.potix.zk.ui.sys.EventProcessingThread.run(EventProcessingThread.java:274
)
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3747779
By: henrichen
How about media.getByteData().length?
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3745832
By: nobody
Thank you very much!
How can I get file size from Fileupload.get()?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3745562
By: tomyeh
Change getStreamData with
InputStream ipuStm = new ByteArrayInputStream(media.getByteData());
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3745556
By: nobody
Can you tell me How do I will be to that I can save the file from
Fileupload.get()
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3745512
By: tomyeh
Use getByteData instead because it is in memory (inMemory returns true).
I'll wrap an input stream on top of the binary array for getStreamData, but have to wait for next nightly.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3745505
By: nobody
The error is :
[B@13f8d12
image/jpeg
12 2006-5-23 9:13:39 com.potix.zk.ui.sys.PageImpl interpret:416
a﹐¥e??: >>bsh.TargetError: Sourced file: inline evaluation of: `` {
filewin.upload(); } ;'' : Method Invocation filewin.upload
>>java.lang.IllegalStateException
>> at com.potix.image.AImage.getStreamData(AImage.java:165)
>> at com.uit.netdisk.zk.fileOperate.FileManagerWindow.upload(FileManagerWindow.
java:263)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at bsh.Reflect.invokeMethod(Unknown Source)
>> at bsh.Reflect.invokeObjectMethod(Unknown Source)
13 2006-5-23 9:13:39 com.potix.zk.ui.sys.UiEngineImpl resumeAll:628
a﹐¥e??: Unable to resume [Event processing thread: event=null, ceased=false] java.lang.IllegalStateException
at com.potix.image.AImage.getStreamData(AImage.java:165)
at com.uit.netdisk.zk.fileOperate.FileManagerWindow.upload(FileManagerWindow.ja
va:263)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at bsh.Reflect.invokeMethod(Unknown Source)
at bsh.Reflect.invokeObjectMethod(Unknown Source)
at bsh.Name.invokeMethod(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at com.potix.zk.ui.sys.PageImpl.interpret(PageImpl.java:409)
at com.potix.zk.ui.sys.EventProcessingThread.process0(EventProcessingThread.jav
a:359)
at com.potix.zk.ui.sys.EventProcessingThread.run(EventProcessingThread.java:274
)
Asked: 2006-05-22 10:51:48 +0800
Seen: 437 times
Last updated: Apr 23 '11