236
The following example uses the ZIPFile property to extract a file (somefile.exe) from
another file (d:\\downloads\\test.zip):
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);
}
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;
//Identify the files to be compressed
var ZIPFiles = ‘d:\\projects\\hs4\\scripts\\test.htm’;
ZIPFiles = ZI ‘\n’ + ‘d:\\projects\\hs4\\scripts\\test.zip’;
ZIPFiles = ZI ‘\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 );
Summary of Contents for COLDFUSION 4.5
Page 1: ...Allaire Corporation Using ColdFusion Studio ColdFusion Studio 4 5 for Windows 95 98 NT4 2000...
Page 16: ...xvi Contacting Allaire...
Page 90: ...82...
Page 130: ...122...
Page 133: ...141 Two VTML tags CAT and E let you customize the content of these dialog boxes...
Page 182: ...190...