I almost always want that, so it never seemed to be an issue to me, but I could see the point. I had utilized the standard ApEx routines for downloading files from a blob in my custom table. This has the following code:
htp.p('Content-length: ' || v_length);
-- the filename will be used by the browser if the users does a save as
htp.p('Content-Disposition: attachment; filename="' || v_file_name || '"');
-- close the headers
-- download the BLOB
wpg_docload.download_file( Lob_loc );
This code is fine and it does just what it will do, but the blue text causes (at least some, including IE) browsers to force a download, and never open within the browser.
It was easy to comment out that line, but that left another issue. Now when the user does a save (right clicks and does "Save as" or saves from the plugin) it doesn't have the correct filename. It will have as a filename whatever comes after the last slash (/) in the url. That probably looks something like my_package.download?p_id=12442. Users really didn't like that.
So . . . What to do? We changed the download links to look like this instead:
Then we used an Apache rewrite rule to route that to our download routine (my_package.download?p_id=12442). Here is the rule:
RewriteRule ^/apexfiledownload/([^/]+)/?(.*) /htmldb/my_package.download?p_id=$1 [PT]
That works and everyone is happy now.
I have an idea that I could also have implemented this by simply changing the offending line from attachment to inline:
htp.p('Content-Disposition: inline; filename="' || v_file_name || '"');
Testing that will be left to another day.