Methods
Add Path, {Recurse}, {Flatten}
Adds the files specified in Path to the Archive.
| Parameter |
Description |
| Path |
String
containing the File path to be used to add files
to the Archive. It may contain wildcard characters (* and ?). |
| Recurse |
Optional
boolean on whether to recurse directories/folders. The default is False. |
| Flatten |
Optional
boolean on whether to strip directory/folder information before adding the files to the
archive. The default is False. |
Returns: Nothing
Notes:
The Add method allows you to add files to the Archive. It cannot be used until the OpenArchive or NewArchive
method is called.
 |
Adds are not made permanent until the SaveArchive method is
called. |
If Recurse is set to True and Flatten is not set to True, relative path
information for any files located in subdirectories of Path will be stored in the
Archive. This path information is always based on the physical path. Even if you specify a
virtual path for the Path parameter, it is first translated to a physical path.
 |
If a file specified by the Path parameter already exists in the same
relative path position, it is overwritten. |
Example: The following example shows how to add a group of files to an
archive:
Set Archive = Server.CreateObject("File Transfer CS .Archive")
Archive.NewArchive "new.zip"
Archive.Add "foo/*.*", True
Archive.SaveArchive
See Also: Archive.OpenArchive method, Archive.NewArchive method, Archive.SaveArchive
method
CloseArchive
The CloseArchive method closes a currently open archive. Use this
method if you wish to delete a currently open Archive.
Example: The following example shows how to delete an open Archive.
Set Archive = Server.CreateObject("File Transfer CS .Archive")
Archive.NewArchive "new.zip"
Archive.Add "foo/*.*", True
Archive.SaveArchive
Archive.CloseArchive
Set File = Server.CreateObject("File Transfer CS .File")
File.Name = "new.zip"
File.Delete
Delete Path
Deletes the file specified by Path.
| Parameter |
Description |
| Path |
String
containing the relative path (if any) and file name to be deleted from the Archive.
Wildcard characters are not supported. |
Returns: Nothing
Notes:
The Delete method allows you to delete a file from the Archive. It
cannot be used until the OpenArchive or NewArchive method is called.
 |
Deletes are not made permanent until the SaveArchive method
is called. Once SaveArchive is called, any files deleted can not be restored. |
Example: The following example shows how to delete a specific file in
an archive:
Set Archive = Server.CreateObject("File Transfer CS .Archive")
Archive.OpenArchive "foo.zip"
Archive.Delete "readme.html"
Archive.SaveArchive
See Also: Archive.OpenArchive method, Archive.NewArchive method, Archive.SaveArchive
method
Extract SourcePath, DestPath
Extracts the files specified in SourcePath from the Archive to DestPath
in the server's file system.
| Parameter |
Description |
| SourcePath |
String
containing the relative path (if any) and file name to be used to extract files from the
Archive. The file name may contain wildcard characters (* and ?). |
| DestPath |
String
containing the path where the files should be
extracted to. If the path contains directory/folder information they will be created
automatically. |
Returns: Nothing
Notes: The Extract method allows you to extract
files from the Archive. It cannot be used until the OpenArchive or NewArchive method is
called.
 |
Any extracted files that already exist in the DestPath
folder will be overwritten. |
Example: The following example shows how to extract all of the text
files located in a specific folder from an archive:
Set Archive = Server.CreateObject("File Transfer CS .Archive")
Archive.OpenArchive "foo.zip"
Archive.Extract "bar\*.txt","C:\temp"
See Also: Archive.OpenArchive method, Archive.NewArchive method
NewArchive Path {,ArchiveType}
Creates a new Archive.
| Parameter |
Description |
| Path |
String
containing the path for the new Archive. |
| ArchiveType |
Optional
long value indicating the type of archive. See ArchiveType
property for valid values. |
Returns: Nothing
Notes: The NewArchive method allows you to create a new
Archive. If ArchiveType is not specified, the type of archive created will be
based on the file extension specified in Path as follows:
| File Extension |
Archive Type |
| .ZIP |
Zip Archive |
| .SIT |
Stuffit Archive |
| .TAR |
TAR Archive |
| .GZ |
GnuZip Archive |
| .BIN |
MacBinary Archive |
An error occurs if ArchiveType is not specified and the
extension does not match any of the above supported extensions.
 |
The file is not actually created until the SaveArchive method is called. |
Example: The following example shows how to create a new archive:
Set Archive = Server.CreateObject("File Transfer CS .Archive")
Archive.NewArchive "new.zip"
See Also: Archive.ArchiveType property,
Archive.NewArchive method, Archive.SaveArchive
method
OpenArchive Path
Opens an existing Archive.
| Parameter |
Description |
| Path |
String
containing the path for the Archive. |
Returns: Nothing
Notes: The OpenArchive method allows you to open an
existing Archive. The type of Archive is automatically determined.
Example: The following example shows how to open an existing archive:
Set Archive = Server.CreateObject("File Transfer CS .Archive")
Archive.OpenArchive "foo.zip"
See Also: Archive.NewArchive method
SaveArchive {Path}
Saves an existing Archive.
| Parameter |
Description |
| Path |
Optional
string containing the path for the Archive. |
Returns: Nothing
Notes: The SaveArchive method allows you to save an
Archive along with any updates made by the Add and Delete methods.
 |
If you do not call this method, any updates made by the Add
and Delete methods will be lost. |
If Path is specified the original archive is unchanged and all
saved archive represents the original archive with all modifications.
 |
If Path is not specified the original archive is
overwritten and can not be restored. |
Example: The following example shows how to save an archive:
' Code showing initialization and updates to the Archive object omitted
Archive.SaveArchive
See Also: Archive.Add method, Archive.Delete method
|