setPassword (password : string) : void

The generated .zip file can be given a password with the method »setPassword()«.


The password still has no influence whatsoever on opening the file! Only for unzipping is it necessary to enter the relevant correct password.

If the display of the file list is to be hidden already, then the .zip file must be rendered into a passwort-protected .zip again.


The password to be set is transferred as a string to the parameter »password«.


The following example demonstrates the use of the method »setPassword()«.

<xsl:stylesheet xmlns:xsl="" xmlns:b="" xmlns:zip="" xmlns:onion="" version="1.0">
<xsl:template match="/">
<xsl:variable name="zip" select="zip:create(0, 'off')" />
<xsl:value-of select="zip:setPassword('')" />
<xsl:value-of select="zip:finish()" />
<b:output mimeType="application/zip">
<b:webResponse dispositionType="attachment" filename="" />

It is important for the method to be called directly after calling the method »create()«.

See also