Previous - zipCreate Section Home - Zip Compression Next - zipClose


zipAdd ( )

Adds a file into the zip archive

Usage:

zipAdd (object me, string filePath, string destName)

Parameters:

filePath (string) - The path to an existing file to add into the zip archive

destName (string) - The folder and fileName stored into the the zip archive

Returns:

(integer) - The success code

Example:

xtRose = xtra("Rosetta").new( )
if xtRose.zipCreate( "C:\DirectorData.zip" ) > 0 then
  xtRose.zipAdd( "C:\Program Files\Macromedia\Director 8.5\Welcome.dcr", "myNewFolder\shock.dcr" )
  xtRose.zipAdd( "C:\Program Files\Macromedia\Director 8.5\credits.dcr", "credits.dcr" )
end if

Notes:

The parameter destName is typically used to specify the relative path from the zip archive when extracting the archive. You could also specify an absolute path such as "C:\Program Files\Macromedia\Director 8.5\credits.dcr". With the example above, program such as WinZip or winRAR will typically force extraction of "credits.dcr" in "C:\Program Files\Macromedia\Director 8.5\". Use absolute path in the destName parameter only if necessary, otherwise consider using relative pathing schemes.


Previous - zipCreate Section Home - Zip Compression Next - zipClose