ZATS Download

From Documentation
< User:Paowang
Revision as of 10:41, 4 June 2012 by Paowang (talk | contribs) (Created page with "In a ZK application, developers usually perform a download through the <javadoc>org.zkoss.zul.Filedownload</javadoc> when some events occurred.<ref>for more detail, please refer ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In a ZK application, developers usually perform a download through the Filedownload when some events occurred.[1].

The following is a typical example about downloading a file:

<zk>
	<button id="btn" label="download">
		<attribute name="onClick"><![CDATA[
			org.zkoss.zul.Filedownload.save("foo.txt", "application/octet-stream");
		]]>
		</attribute>
	</button>
</zk>

Actually, the download mechanism is a two steps process. When you invoke save method, the Filedownload simply notifies ZK client engine of the download URL. Then, the client engine download such file according to the received URL.

Notes


Download file in ZATS mimic test case

In order to archive same behavior as ZK client engine, ZATS mimic introduces Resource. you can get the current downloadable resource from the method of desktop.