The QueryMemoryFile event is triggered when the Zip method is called, and allows you to zip up data directly from memory into a file entry in the zip file. You can cause the QueryMemoryFile event to be triggered multiple times if you have more than one file you wish to zip up directly from memory.
Each time the QueryMemoryFile event is triggered, you must provide a filename to give the data you are zipping up from memory, and you can also specify file attributes, a file comment, and other file information for the data.
Set the QueryMemoryFile event's bFileProvided flag to true if you do indeed have a file to zip up directly from memory. Whenever this flag is set to True, the QueryMemoryFile event will be triggered again, so you can provide another filename to zip up. Set the flag to False when you do not have any more files to zip up directly from memory.
If you don't write a handler for the QueryMemoryFileEvent, no files will be zipped directly from memory because the default value for the bFileProvided flag is False.
The actual data for each file to zip up from memory must be provided later, when the ZippingMemoryFile event is triggered.
Declaration (DLL API) | |
---|---|
Event QueryMemoryFile(lUserTag As Long, sFilename As String, sComment As String, xAttributes As xcdFileAttributes, |
Declaration (DLL API) | |
---|---|
xcdQueryMemoryFileParams * pParams = (xcdQueryMemoryFileParams * ) lParam; |
Parameter | Modifiable | Description |
---|---|---|
lUserTag | YES | A user defined tag you can specify. This tag is provided to you later, when the ZippingMemoryFile event is triggered. If you don't explicitly set this tag to your own value, it starts at 0 and is incremented when the next QueryMemoryFile event is triggered. |
sFilename | YES | The file to create in the zip file which will contain the data to be compressed directly from memory. |
sComment | YES | A comment for the file. |
xAttributes | YES | The file's attributes. |
dtLastModified | YES | The file's last modification date and time. |
dtLastAccessed | YES | The file's last accessed date and time. |
dtCreated | YES | The file's creation date and time. |
bEncrypted | YES | Should this file be encrypted? |
sPassword | YES | Use this password to encrypt the file. |
bFileProvided | YES | Flag informing Xceed Zip that you have a file to zip up from memory. |