addBinary (filename : string, xlink : string, [fromDataSource : boolean]) : void
Using the method »addBinary()«, binary files such as pictures or pdf files located in the system can be added to the .zip stream.
Parameter
The complete file name is transferred to the parameter »filename« complete with file extension, just as it shall be contained in the .zip later on.
The XLink to the binary method that produces the binary file must be transferred to the parameter »xlink«. If the binary file is read directly from the data source, then the XLink can only consist of the onion.net ID.
»fromDataSource« can be specified as a last parameter in order to control whether the binary file is produced from the data source. If the link to an external binary method was transferred to the parameter »xlink«, then »fromDataSource« must receive the value »false()«.The value »true()« is implicitly set.
Beispiel
The following example produces an empty .zip binary stream, adds a PDF file which is not read from the data source and lastly produces the .zip file.