Reputation: 585
I have a REST API (returns BLOB) which I call in Oracle Apex, and then that is downloaded in browser using following code
sys.HTP.init;
OWA_UTIL.mime_header( p_mimetype, FALSE, 'UTF-8' );
sys.HTP.p( 'Content-Disposition: attachment; filename="' || p_download_file_name || '"' );
sys.HTP.p( 'Content-length: ' || sys.DBMS_LOB.getlength( p_file_blob ) );
sys.OWA_UTIL.http_header_close;
v_output_blob := p_file_blob;
WPG_DOCLOAD.download_file( v_output_blob );
APEX_APPLICATION.stop_apex_engine;
This is working, but the file size is coming up too large sometimes, and I want to compress it.
I have tried UTL_COMPRESS.LZ_COMRESS, which do compress the size, but it make the BLOB unrenderable as PDF. I get an error when I try to open the downloaded file.
Using Oracle 19c, with 21.2 Apex
Any suggestions?
Upvotes: 0
Views: 129