PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Compression level
  • Error codes
  • Use condition
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Creates an archive. The created archive is automatically:
  • opened in read/write. If the archive is in CAB format, the created archive is opened in write-only.
  • a single-part archive.
The created archive can be:
  • in standard WinZip or PKZip format (.ZIP extension).
  • in "Cabinet files" format (.CAB extension).
  • in WINDEV format (.WDZ extension).
  • Versions 18 and later
    in 7z format (.7z extension).
    New in version 18
    in 7z format (.7z extension).
    in 7z format (.7z extension).
  • Versions 21 and later
    in TAR format (.TAR extension).
    New in version 21
    in TAR format (.TAR extension).
    in TAR format (.TAR extension).
  • Versions 21 and later
    in TGZ (TAR.GZ) format (.TGZ or.TAR.GZ extension).
    New in version 21
    in TGZ (TAR.GZ) format (.TGZ or.TAR.GZ extension).
    in TGZ (TAR.GZ) format (.TGZ or.TAR.GZ extension).
No archive in "RAR" format can be created.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
WINDEVWEBDEV - Server codeWindows This function now supports the 7z format.
New in version 18
Android Widget This function is now available in Android Widget mode.
WINDEVWEBDEV - Server codeWindows This function now supports the 7z format.
Android Widget This function is now available in Android Widget mode.
WINDEVWEBDEV - Server codeWindows This function now supports the 7z format.
Versions 19 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 19
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadUniversal Windows 10 App This function now supports the TAR and TGZ (TAR.GZ) formats.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadUniversal Windows 10 App This function now supports the TAR and TGZ (TAR.GZ) formats.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadUniversal Windows 10 App This function now supports the TAR and TGZ (TAR.GZ) formats.
WINDEVWEBDEV - Server codeJavaAjaxUser code (UMC)
// Create the archive
ResCreate = zipCreate("MyArchive", "C:\Temp\Archive.zip")
IF ResCreate = 0 THEN
// Add a file into an archive
ResAddFile = zipAddFile("MyArchive", ...
"C:\MyDirectory\MyFiles\File.pdf", zipDrive)
END
// Display an error message if the file was not added
IF ResAddFile <> 0 THEN
Error(zipMsgError(ResAddFile))
END
Windows Mobile
// Create the archive
ResCreate = zipCreate("MyArchive", "\Temp\Archive.zip")
IF ResCreate = 0 THEN
// Add a file into an archive
ResAddFile = zipAddFile("MyArchive", ...
"\MyDirectory\MyFiles\File.pdf", zipNone)
END
// Display an error message if the file was not added
IF ResAddFile <> 0 THEN
Error(zipMsgError(ResAddFile))
END
Syntax
<Result> = zipCreate(<Archive> , <Archive Path> [, <Options>])
<Result>: Integer
  • 0 if the creation was performed. In this case, the archive is opened. In order for this archive to be handled by the user before closing the application, don't forget to close the archive (zipClose).
  • An error code (value greater than 0) otherwise. See the Notes for more details.
<Archive>: Character string (with quotes) or zipArchive variable
Name of archive to create.
This name can correspond to:
  • the name of an archive.
  • Versions 15 and later
    WINDEVWEBDEV - Server codeReports and QueriesWindows MobileAjax the name of a zipArchive variable.
    New in version 15
    WINDEVWEBDEV - Server codeReports and QueriesWindows MobileAjax the name of a zipArchive variable.
    WINDEVWEBDEV - Server codeReports and QueriesWindows MobileAjax the name of a zipArchive variable.
<Archive Path>: Character string (with quotes)
Path and name of archive (up to 260 characters). The archive extension must be specified:
  • ".WDZ" to create a WINDEV archive.
  • ".ZIP" to create an archive in WinZip or PKZip format.
  • ".CAB" to create an archive in "Cabinet Files" format.
  • Versions 18 and later
    ".7z" to create an archive in 7Z format.
    New in version 18
    ".7z" to create an archive in 7Z format.
    ".7z" to create an archive in 7Z format.
  • Versions 21 and later
    ".TAR" to create an archive in TAR format.
    New in version 21
    ".TAR" to create an archive in TAR format.
    ".TAR" to create an archive in TAR format.
  • Versions 21 and later
    ".TAR.GZ" to create an archive in TAR.GZ format.
    New in version 21
    ".TAR.GZ" to create an archive in TAR.GZ format.
    ".TAR.GZ" to create an archive in TAR.GZ format.
  • Versions 21 and later
    ".TGZ" to create an archive in TGZ format.
    New in version 21
    ".TGZ" to create an archive in TGZ format.
    ".TGZ" to create an archive in TGZ format.
If no extension is specified, an archive in WDZ format is created.
Caution:
  • LinuxiPhone/iPadUniversal Windows 10 App Only the archives in ZIP, TAR and TGZ (TAR.GZ) format are available.
  • AndroidAndroid Widget Windows MobileJava Only the archives in ZIP format are available.
  • AndroidAndroid Widget Java If the .WDZ extension is specified, the created archive will be in ZIP format, but with a .WDZ extension.
  • If the same archive already exists in the specified directory, this archive is overwritten by the new archive.
Universal Windows 10 App The archive path is a full path or a path relative to the working directory of application (returned by fDataDir).
<Options>: Optional constant
Options for managing the archives:
Versions 17 and later
zipAnsi
New in version 17
zipAnsi
zipAnsi
Used to force the backup of file names in Ansi format in the Archive file.
This constant is used by default in an application that is using the Ansi mode.
AndroidAndroid Widget iPhone/iPadJava This constant is not available.
zipHeader64Allows you to create an archive exceeding 4 GB on which zipChangePath can be used.
By default, this option is not used.
Versions 21 and later
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
New in version 21
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
AndroidAndroid Widget iPhone/iPadJava This constant is not available.
zipUncompressedThe content of the archive will not be compressed.
Used with the CAB archives, this constant allows you to only use the function for archiving the CAB format.
By default, this option is not used.
Versions 21 and later
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
New in version 21
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
Versions 17 and later
zipUnicode
New in version 17
zipUnicode
zipUnicode
Used to force the backup of file names in Unicode format in the Archive file.
This constant is used by default in an application that is using the Unicode mode.
Versions 21 and later
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
New in version 21
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
Archive in TAR or TGS (TAR.GZ) format: This constant is not available.
AndroidAndroid Widget iPhone/iPadJava This constant is not available.
Archive in 7z format: This parameter is not available.
Universal Windows 10 App This parameter is not available.
Remarks

Compression level

The files added into an archive in Zip format are compressed by default. The compression level of files added into an archive can be modified by zipCompressionLevel.

Error codes

The following error codes are returned:
  • 1: The path passed in parameter does not exist.
  • 2: Access denied: the user has no sufficient rights.
The message corresponding to the error code is returned by zipMsgError.

Use condition

The maximum number of files that can be included:
  • in a WDZ file: 232-1.
  • in a ZIP file: 65535.
  • in a CAB file: 65535.
LinuxAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppJava Only the archives in ZIP format are available.
Available formats:
  • LinuxiPhone/iPadUniversal Windows 10 App Only the archives in ZIP, TAR and TGZ (TAR.GZ) format are available.
  • AndroidAndroid Widget Windows MobileJava Only the archives in ZIP format are available.
The size of a file included in an archive (regardless of its format) must be less than 4 GB.
No archive in "RAR" format can be created.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230zip.dll
Windows Mobile wp230zip.dll
Java wd230java.jar
Linux wd230zip.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment