[Overview][Constants][Types][Classes][Index] | Reference for unit 'Zipper' (#fcl)

# TZipFileEntries.AddFileEntry

Adds file to zip directory

## Declaration

Source position: zipper.pp line 404

`public function TZipFileEntries.AddFileEntry(`
`const ADiskFileName: string`
`):TZipFileEntry; function TZipFileEntries.AddFileEntry(`
`const ADiskFileName: string;`
`const AArchiveFileName: string`
`):TZipFileEntry; function TZipFileEntries.AddFileEntry(`
`const AStream: TStream;`
`const AArchiveFileName: string`
`):TZipFileEntry;`

## Arguments

`ADiskFileName` |  | Name of the file or directory on the local file system

## Function result

Collection item added in the method

## Arguments

`ADiskFileName` |  | Name of the file or directory on the local file system
`AArchiveFileName` |  | Name used for the file or directory in the .ZIP archive

## Arguments

`AStream` |  | Stream with the content for the zip file entry
`AArchiveFileName` |  | Name used for the file or directory in the .ZIP archive

## Description

AddFileEntry adds a file or directory to the list of entries that will be written out in the .zip file. AddFileEntry calls the Add method to create the new collection item, and casts it the TZipFileEntry type used in TZipFileEntries.

Values passed as arguments to the overloaded variants are stored in the corresponding properties in the TZipFileEntry instance.

The return value is the TZipFileEntry instance added to the collection.