45.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.
Note:
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
Table 45-1 ADD_FILE Procedure Parameters
Parameter | Description |
---|---|
|
BLOB containing the zip file. |
|
File name, including path, of the file to be added to the zip file. |
|
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