-
FEATURED COMPONENTS
First time here? Check out the FAQ!
How can I use the file loading feature of ZK?
I want to load an excel file from my local machine to the server machine using a UI application running on the server machine.
Can anybody help?
Thanks,
Dino
Sure, but you'll need to explain in more detail what your exact problem is. I can upload Excel-Files via ZK-Fileupload without problems to a server.
Cheers, Maik
When a file is uploaded, your application receives an UploadEvent. You can get a Media-Object from it:
http://docs.zkoss.org/wiki/Developer_reference_The_XUL_Components_Events_UploadEvent
Here's an example:
<zk> <button label="Upload" upload="true"> <attribute name="onUpload">{ org.zkoss.util.media.Media media = event.getMedia(); java.io.InputStream inputStream = media.inMemory() ? new java.io.ByteArrayInputStream(media.getByteData()) : media.getStreamData(); // Now you can process inputStream... }</attribute> </button> </zk>
HTH, Maik
Asked: 2010-06-16 23:57:07 +0800
Seen: 466 times
Last updated: Jun 20 '10