0

file loading feature of ZK

asked 2010-06-16 23:57:07 +0800

din gravatar image din
251 1 5

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

delete flag offensive retag edit

10 Replies

Sort by ยป oldest newest

answered 2010-06-17 00:36:55 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Hi,

please have a look at the fileupload-demo:

http://www.zkoss.org/zkdemo/userguide/#u1

HTH, Maik

link publish delete flag offensive edit

answered 2010-06-17 00:37:15 +0800

jentrees gravatar image jentrees
51 1

You can use zkspeadsheet

link publish delete flag offensive edit

answered 2010-06-17 01:13:59 +0800

din gravatar image din
251 1 5

Hi Maik, I had seen it earlier but I couldn't implement that for MS excel.
Can you help?

Thanks,
Dino

link publish delete flag offensive edit

answered 2010-06-17 02:51:29 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

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

link publish delete flag offensive edit

answered 2010-06-17 03:55:36 +0800

din gravatar image din
251 1 5

I need the lines of code where on hitting the upload button and selecting the file it gets uploaded to server.

Thanks,
Dino

link publish delete flag offensive edit

answered 2010-06-17 04:15:37 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

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

link publish delete flag offensive edit

answered 2010-06-17 04:49:39 +0800

din gravatar image din
251 1 5

Hi Maik, Thank u very much..I will try this code and get back in case I find any issue further.

Best rgrds,
Dino

link publish delete flag offensive edit

answered 2010-06-17 05:00:35 +0800

din gravatar image din
251 1 5

Is this event in the code you has written is EVENT type or some other variable?
I am getting an error saying this method is unavailable for type EVENT.

Thanks,
Dino

link publish delete flag offensive edit

answered 2010-06-17 06:22:55 +0800

din gravatar image din
251 1 5

Also it is taking a lot of time to load an excel file? Is it a normal thing or my application is taking a lot of time?

Thanks,
Dino

link publish delete flag offensive edit

answered 2010-06-20 20:57:05 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

@din,

http://www.zkoss.org/javadoc/5.0/zk/org/zkoss/zk/ui/event/UploadEvent.html

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: 2010-06-16 23:57:07 +0800

Seen: 466 times

Last updated: Jun 20 '10

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