I have a blob column and an Oracle APEX page to download file.
declare
l_blob blob;
l_sql_delimiter varchar2(30);
l_lang_context integer := DBMS_LOB.DEFAULT_LANG_CTX;
l_warning integer := DBMS_LOB.WARN_INCONVERTIBLE_CHAR;
l_dest_offset integer := 1;
l_source_offset integer := 1;
ln_length number;
LV_TABLENAME VARCHAR2(100);
LV_FILENAME VARCHAR2(1000);
LN_JOB_ID NUMBER;
begin
-- SELECT C.N001 into LN_JOB_ID FROM APEX_COLLECTIONS C
-- WHERE C.COLLECTION_NAME = 'DOWNLOAD_INFO';
-- LV_FILENAME := LV_TABLENAME || '.txt';
dbms_lob.createtemporary(l_blob, true);
select file_name, file_content into lv_filename, l_blob from XXDM_REPORT_DOWNLOADS
where job_id = :P5183_JOB_ID;
ln_length := DBMS_LOB.GETLENGTH(l_blob);
sys.htp.init;
sys.owa_util.mime_header( 'application/octet-stream', false,'UTF-8' );
sys.htp.p('Content-length: ' || to_char(ln_length));
sys.htp.p('Content-Disposition: inline; filename="' || LV_FILENAME || '"' );
sys.owa_util.http_header_close;
sys.wpg_docload.download_file(l_blob);
apex_application.stop_apex_engine;
exception when others then
sys.htp.prn('error: '||sqlerrm);
apex_application.stop_apex_engine;
end;
Is it possible to achieve download of such large file? If so, can you please help me fix this issue?