tag:blogger.com,1999:blog-18037024.post6702413374732871898..comments2024-02-16T14:33:11.277+01:00Comments on Annals of Oracle's Improbable Errors: About downloading files from an Apex page without using download linksByte64http://www.blogger.com/profile/15629209362377395020noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-18037024.post-66280009846699709582015-10-13T23:17:51.503+02:002015-10-13T23:17:51.503+02:00Hi Flavio,
We had code that worked with Apex 4.0 ...Hi Flavio,<br /><br />We had code that worked with Apex 4.0 for many years.<br />This code downloaded PDF documents.<br />Code was in Pre Rendering -> Before Header process<br /><br />1) code fetched blob (pdf) from table<br />2) set mime type with owa_util.mime_header<br />3) call WPG_DOCLOAD.DOWNLOAD_FILE<br />4) stop apex engine<br /><br />After upgrade to Apex 5.0 <br />we changed step #4 Levhttps://www.blogger.com/profile/07738586409100836666noreply@blogger.comtag:blogger.com,1999:blog-18037024.post-40990630209085229332015-10-12T16:32:50.208+02:002015-10-12T16:32:50.208+02:00Lev,
I can confirm that on Apex 5.0 with ORDS as w...Lev,<br />I can confirm that on Apex 5.0 with ORDS as web server I don't see the issue of the MIME type, I am exporting TEXT/CSV files and Firefox is suggesting to open the file with Numbers, the spreadsheet application made by Apple.<br /><br />There must be something else going on.<br /><br />FlavioFlavio Casettahttps://www.blogger.com/profile/00127224576368111904noreply@blogger.comtag:blogger.com,1999:blog-18037024.post-33847437979348921952015-10-09T12:54:42.348+02:002015-10-09T12:54:42.348+02:00Lev,
are you experiencing the problem with the MIM...Lev,<br />are you experiencing the problem with the MIME header only on Apex 5.0?<br /><br />I made a test with an application I wrote on 4.2 with different files having various MIME headers and I cannot replicate the problem you describe, I can always set the correct MIME header without the need of invoking those extra APIs.<br /><br />I wondering if it could depend on some specific Byte64https://www.blogger.com/profile/15629209362377395020noreply@blogger.comtag:blogger.com,1999:blog-18037024.post-51011935826422880072015-10-08T17:23:34.468+02:002015-10-08T17:23:34.468+02:00Hi Lev,
good idea, I'll try with the temp vari...Hi Lev,<br />good idea, I'll try with the temp variable.<br /><br />Regarding the mime type, I'll check when I can, but I don't remember noticing anything strange.<br /><br />Thank you<br />FlavioByte64https://www.blogger.com/profile/15629209362377395020noreply@blogger.comtag:blogger.com,1999:blog-18037024.post-37174222347298866032015-10-08T16:34:35.470+02:002015-10-08T16:34:35.470+02:00If you can not delete record after WPG_DOCLOAD.DOW...If you can not delete record after WPG_DOCLOAD.DOWNLOAD_FILE than delete it before.<br /><br />1) load clob (or blob) from your table into temp variable<br />2) delete record<br />3) call WPG_DOCLOAD.DOWNLOAD_FILE<br />...<br /><br />By the way in APEX 5 I was not able to set <b>Content-type</b> in http header with <br />ordinary call owa_util.mime_header<br /><br />I had to use:<br /><br /> Levhttps://www.blogger.com/profile/07738586409100836666noreply@blogger.comtag:blogger.com,1999:blog-18037024.post-20224331753120341462015-10-07T21:11:28.806+02:002015-10-07T21:11:28.806+02:00Hi SC,
if I have to call the scheduler then I can ...Hi SC,<br />if I have to call the scheduler then I can skip the is_downloaded column altogether, it's enough to invoke the job passing the key as a parameter.<br /><br />Thank you,<br />FlavioByte64https://www.blogger.com/profile/15629209362377395020noreply@blogger.comtag:blogger.com,1999:blog-18037024.post-45489941351470769962015-10-07T17:12:25.854+02:002015-10-07T17:12:25.854+02:00Give your table a column "is_downloaded"...Give your table a column "is_downloaded", update the row before "WPG_DOCLOAD.DOWNLOAD_FILE" and write a procedure or something else to delete all rows with "is_downloaded" = "true". Event: for example: Scheduler JobSCnoreply@blogger.com