62.2 ADD_FILE Procedure
This procedure adds a single file to a zip file. You can call this procedure multiple times to add multiple files to the same zip file.
Tip:
After all files are added, you must call the APEX_ZIP.FINISH
procedure.
Syntax
APEX_ZIP.ADD_FILE (
p_zipped_blob IN OUT NOCOPY BLOB,
p_file_name IN VARCHAR2,
p_content IN BLOB )
Parameters
Parameter | Description |
---|---|
p_zipped_blob |
BLOB containing the zip file. |
p_file_name |
File name, including path, of the file to be added to the zip file. |
p_content |
BLOB containing the file. |
Example
This example reads multiple files from a table and puts them into a single zip file.
DECLARE
l_zip_file blob;
BEGIN
FOR l_file in ( SELECT file_name,
file_content
FROM my_files )
LOOP
apex_zip.add_file (
p_zipped_blob => l_zip_file,
p_file_name => l_file.file_name,
p_content => l_file.file_content );
END LOOP;
apex_zip.finish (
p_zipped_blob => l_zip_file );
END;
See Also:
Parent topic: APEX_ZIP