Apex blob download issues
I have inherited this feature and would like to, discuss an issue I am having
apex 5.0
oracle db 12c
browser os : windows 7
chrome : Version 56.0.2924.87 (upto date)
IE : 11.0.96
The application presents a report with a list of files. the filename being a link to download or open the file depending on the mime type.
Slightly annoyingly in chrome and IE pdf files are opening in a new window simply entitled "f" rather than the filename.
more annoyingly in IE files are opening in memory with a doc named of "f". this doesn’t happen in chrome.
Report setup
============
something like
select
filename, "some code if not authorised then 'disabled-link'" onclick,
case
when file_mimetype like '%/pdf' or file_mimetype like 'image/%' or file_mimetype like 'text/%' then '_blank'
else '_self'
end target,
file_ext ,
rowid row_id
the link setup
================
link on filename in report
target : page - same page as link
set items Pn_rowid #ROW_ID#
link name: #FILE_NAME#
link attributes: target="#TARGET#" class="filetype #FILE_EXT# #ONCLICK#"
ADVANCED : APPLICATION_PROCESS=FILESTORE
ajax callback on same page called FILESTORE
my_download(:pn_rowid);
PROCEDURE my_download in the db
htp.p('Content-Type: '||v_mimetype);
htp.p('Cache-Control: no-cache');
htp.p('Content-Disposition: inline; filename="'||v_filename_display||'"');
owa_util.http_header_close;
wpg_docload.download_file(v_blob);