MACROMEDIA COLDFUSION STUDIO 4.5-USING COLDFUSION STUDIO Use Manual page 228

For windows 95/98/nt4/2000
Table of Contents

Advertisement

236
The following example uses the ZIPFile property to extract a file (somefile.exe) from
another file (d:\\downloads\\test.zip):
function Main () {
}
Methods
Add
function Add(Files: OleVariant; bRecurse, bIncludeDirs, bIncludeHiddenFiles,
bIncludeVolumeLabels: WordBool): Integer
Adds files to an archive. The Files parameter can be used to narrow down the group of
files to add. You can specify a single file, a set of files delimited by line breaks or an
entire directory using wildcards. Use the bRecurse parameter to add subfolders. Use
bIncludeDirs to specify whether directory information should be stored in the archive.
Use bIncludeHiddenFiles and bIncludeVolumeLabels to restrict the inclusion of
hidden files or volume labels. Do not set the bIncludeVolumeLabels parameter to true
unless you specify the drive letter as the first element in the Files parameter. The Files
parameter may contain multiple elements separated by line breaks.
The function returns a status code which can be investigated to determine the
success of the operation.
For example:
function Main () {
var hsOKInfo = 64;
var app = Application;
var ZIPPro = app.ZIPProvider;
ZIPPro.ExtractionDir = 'd:\\ExtractHere\\'; ZIPPro.ZipFile =
'd:\\downloads\\test.zip';
var ResultCode = ZIPPro.Extract('somefile.exe');
app.MessageBox( "Return Code :" + ResultCode ,"ZIPProvider",
hsOKInfo);
var hsOKInfo = 64;
var app = Application;
var ZIPPro = app.ZIPProvider;
//Identify the files to be compressed
var ZIPFiles = 'd:\\projects\\hs4\\scripts\\test.htm';
ZIPFiles = ZIPFiles + '\n' + 'd:\\projects\\hs4\\scripts\\test.zip';
ZIPFiles = ZIPFiles + '\n' + 'd:\\projects\\hs4\\scripts\\*.js';
//Add method options
var bRecurse = true;
var bIncludeDirInfo = true;
var bIncludeHidden = true;
var bIncludeVolume = false;
//Create the ZIP file and execute Add method
ZIPPro.ZipFile = 'd:\\newzips\\newarchive.zip';
var nStatusCode = ZIPPro.Add( ZIPFiles , bRecurse, bIncludeDirInfo,
bIncludeHidden, bIncludeVolume );

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion studio 4.5

Table of Contents