ZATS Download
From Documentation
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
- ↑ for more detail, please refer to ZK_Component_Reference/Essential_Components/Filedownload
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.