UpdateFile Method (fileName, directoryPathInArchive)

DotNetZip

Ionic Zip Library v1.9.1.6 UpdateFile Method (fileName, directoryPathInArchive)
ReferenceIonic.ZipZipFileUpdateFile(String, String)
Adds or Updates a File in a Zip file archive.
Declaration Syntax
C# Visual Basic Visual C++
public ZipEntry UpdateFile(
	string fileName,
	string directoryPathInArchive
)
Public Function UpdateFile ( _
	fileName As String, _
	directoryPathInArchive As String _
) As ZipEntry
public:
ZipEntry^ UpdateFile(
	String^ fileName, 
	String^ directoryPathInArchive
)
Parameters
fileName (String)
The name of the file to add or update. It should refer to a file in the filesystem. The name of the file may be a relative path or a fully-qualified path.
directoryPathInArchive (String)
Specifies a directory path to use to override any path in the fileName. This path may, or may not, correspond to a real directory in the current filesystem. If the files within the zip are later extracted, this is the path used for the extracted file. Passing null (Nothing in VB) will use the path on the fileName, if any. Passing the empty string ("") will insert the item at the root path within the archive.
Return Value
The ZipEntry corresponding to the File that was added or updated.
Remarks

This method adds a file to a zip archive, or, if the file already exists in the zip archive, this method Updates the content of that given filename in the zip archive.

This version of the method allows the caller to explicitly specify the directory path to be used in the archive. The entry to be added or updated is found by using the specified directory path, combined with the basename of the specified filename.

Upon success, there is no way for the application to learn if the file was added versus updated.

For ZipFile properties including Encryption, Password, SetCompression, ProvisionalAlternateEncoding, ExtractExistingFile, ZipErrorAction, and CompressionLevel, their respective values at the time of this call will be applied to the ZipEntry added.

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)