File download - wpg_docload NOT opening dialogue ....

Hi all,
I have been researching this for a while, and I can't seem to get to the bottom of it.
Env: Oracle 10.2, Apex 3.2, SuSe (Both EPG and Apache configs)
Here's what I want to do
Allow a user to click on a button to download data from a database table as a file.
%% Region %%%%%%%%%%%%%%%%%%%%
Click on the button below to down the latest report
[BUTTON]
%% End Region %%%%%%%%%%%%%%%%%%
When the user clicks on the button, I would like a "Save As" Dialogue to appear, with the default file name in it, and the use can then save the file.
The button calls the following code, which is within a package :
PROCEDURE DOWNLOAD_APEX_FILE(p_file_id  IN  FILE_UPLOADS.FILE_ID%TYPE)  IS
  l_null_param_str           varchar2(4000) := NULL;
  l_content_type_code        FILE_UPLOADS.CONTENT_TYPE_CODE%TYPE;
  l_file_id                  FILE_UPLOADS.FILE_ID%TYPE;
  l_file_name                FILE_UPLOADS.FILE_NAME%TYPE;
  l_mime_type_code           FILE_UPLOADS.MIME_TYPE_CODE%TYPE;
  l_charset_code             FILE_UPLOADS.DAD_CHARSET_CODE%TYPE;
  l_file_charset_code        FILE_UPLOADS.FILE_CHARSET_CODE%TYPE;
  l_length                   FILE_UPLOADS.DOC_SIZE%TYPE;
  l_blob_content             FILE_UPLOADS.BLOB_CONTENT%TYPE;
BEGIN
  LG.PUSH ('F8_SYNC','DOWNLOAD_APEX_FILE');
  -- get the data from stashed location ..
  select FILE_ID,
         FILE_NAME,
         MIME_TYPE_CODE,
         DOC_SIZE,
         BLOB_CONTENT
    into l_file_id,
         l_file_name,
         l_mime_type_code,
         l_length,
         l_blob_content
    from FILE_UPLOADS
   where FILE_ID = p_file_id;
  l_mime_type_code := 'application/octet';
  LG.D('File ID, name: '||l_file_id||', '||l_file_name);
  LG.D('Doc Size: '||l_length);
  LG.D('Do OWA work.');
  -- Setup HTTP Headers
  owa_util.mime_header( nvl(l_mime_type_code, 'text/plain'), FALSE);
  htp.p('Content-length: '||l_length);
--  htp.p('Content-type: application/octet-stream');
  htp.p('Content-Disposition: attachment; filename="WeatherInfo.csv"');
  owa_util.http_header_close;
  wpg_docload.download_file(l_blob_content);
  TIDY_UP;
  LG.POP;
EXCEPTION
  WHEN OTHERS THEN
    ERR.HANDLE();
END DOWNLOAD_APEX_FILE;(Sorry - Don't seem to be able to format the code snippet - Moderators / admins maybe allow that?)
- Thanks for tip - edited and looks better.
Any help is much appreciated as this is driving me nuts.
I've tried in Firefox and IE. Same -nothing appears - but the code is executed.
Thanks in advance.
Edited by: PJ on May 2, 2010 6:24 AM

Hi
Thanks for your help.
The code is called by clicking a button. When the buttom is selected a process is called which is "On Sumbit and After computations and Validations"
The process is conditional on the buitton being clicked. This is the code ...
BEGIN
  F8_SYNC.DOWNLOAD_WEATHER_FILE;
EXCEPTION
  WHEN OTHERS THEN
    :P50_ERR := SQLERRM;
END;This code gets the data and stashes it in table FILE_UPLOADS and then calls DOWNLOAD_APEX_FILE, being passed the file ID.
I know it is called because the debug messages are written to my log. (LG calls) and there are no errors.
The download procedure code is in the original post ....
thanks again
Edited by: PJ on May 2, 2010 7:19 AM

Similar Messages

  • All downloads through Firefox are not opening correctly. Bookmarks open up a page with links flush left down the page that do not work. All file downloads do not open correctly with the same issue as bookmarks. Want to avoid losing all my bookmarks so don

    Something happened in the last day with FF. IE downloads files correctly. FF Delicious bookmarks open up a page with blue links that look like an outline but they are not my links. My downloads do the same. No virus.

    That can be caused by having some bookmarks with a long title in the main Bookmarks menu.
    The width of a column in the Bookmarks menu list is in current Firefox versions automatically adjusted to fit the bookmark with the longest name.
    You can check the names of the bookmarks and make the longer ones shorter.

  • HT204382 I have .avi file, so I downloaded and installed Flip4Mac program. But this file is still not opened.

    I have .avi file, so I downloaded and installed Flip4Mac program. But this file is still not opened.
    Please, help me. Thank you

    GraceLee wrote:
    It works!! It works!!
    Thank you. Thank you very much^^
    best wishes,
    GraceLee
    You are welcome
    Happy Computing
    Pete

  • Download do not open as adobe files how do I correct this?

    I have tried to download files they do not open as adobe files how can I correct this?

    Hi loisnelson,
    What type of files are you trying to open, and what are you using to open them? Do you receive an error when you try to open them? And if so, what is that error?
    Please provide a few more details of the problem, and we will do our best to get things sorted out.
    Best,
    Sar

  • Did an adobe update this morning then several of my programs now marked as acrobate files and will not open

    did an adobe update this morning then several of my programs now marked as acrobate files and will not open so i uninstalled acrobat reader and tried reinstalling it several times using google, google chrome and internet explorer and still getting the same problem please advise

    Hi Greg ,
    Could you please provide me the details of the Acrobat version and updates?
    Try uninstalling it with the help of cleaner tool once again and try to install it back from the following link .
    https://helpx.adobe.com/acrobat/kb/acrobat-downloads.html
    Here is the link for Cleaner Tool .
    http://labs.adobe.com/downloads/acrobatcleaner.html
    Disable all the third party software before installing it .
    Regards
    Sukrit Dhingra

  • Imac G5 OS 10.4.11  Itunes not connect, Safari fine,  new downloads will not open, new install of 10.4.11.4

    Imac G5 OS 10.4.11 Itunes will not connect to radio or store.  Errors out check internet connection.  Safari connects fine. 
    New downloads will not open i.e. ms office critical update, nor Filemaker re-validate registration, also new intaller of itunes 9.2.1 etc.
    After clean install of 10.4 and all updates same problem.
    Other 10.4.11 systems I have work fine on ibook etc. 
    Can I move the system app that opens .dmg files from OK system to imac?  Would that even solve the problem?
    Ramon

    You have 10.4.11 Macs that iTunes can connect to the iTunes Store???
    I was pretty sure they changed to a minimum of 10.6.8
    Are downloading iTunes 9.2.1 from here...
    http://support.apple.com/kb/DL1056

  • How can I save a page offline? the "complete" option in "save as" produces a folder w/ 36 kb files that will not open.

    the "complete" option in "save as" produces a folder w/ 36 kb files that will not open anything - can't I save the page as a single offline file?

    This is not really an answer just my comments on your question.
    I am sure I recollect efforts being made to get mhtml to work with FF.
    Probably the important thing to remember about .mhtml is that if other browsers do support it they may need addons, and may not necessarily render the content correctly/consistently.
    There are FF addons designed for archiving webpages, you could try them, but that then assumes the recipient has the same software.
    You could simply save the page from FF to your XP pc; then offline open it with and save it using IE, before then emailing using FF, and attaching the .mht or mhtml file that you have now created on your PC.
    As an alternative method, in some cases it could be worth considering taking a screen grab of the required page, then sending that to the recipient as a single email attatchment using either a bitmap or jpeg file format for instance.
    Something such as an airline booking may be designed with a print option, possibly it could be worthwile looking at sending the print file itself as an email attachment.

  • Please help! My Itunes says corrupt file and will not open (IMac 2010). I couldn't fix it by reinstalling so I moved it to trash. It will not delete from my trash as it is saying "Japanese.lproj" is in use. I can't delete or open to close it, what do I do

    Please help!
    My Itunes says there is a corrupt file and will not open (IMac 2010). I couldn't fix it by reinstalling ITunes so I moved ITunes to trash. It will not delete from my trash as it is saying "Japanese.lproj" is in use. I have never opened or used "Japanese.lproj". I can't delete ITunes or open ITunes to close the Japanese.lproj, what do I do? Thank you for any help you can provide..

    It will not delete from my trash as it is saying "Japanese.lproj" is in use. I have never opened or used "Japanese.lproj".
    Interesting. This sort of thing is more common on Windows systems. Taken at face value, one of the iTunes program files (one of the Japanese language resources) is damaged.
    I'd try running your Disk Utility over your startup disk. Does it find/repair any damage? If so can you empty your trash and reinstall your iTunes successfully now?

  • I need to install iWork 09 so I can open the many pages document files that will NOT open under the new pages 5. Mavericks will not accept an install from my iWork's 09 CD. How do I get around this?

    I need to install iWork 09 so I can open the many pages document files that will NOT open under the new pages 5. Mavericks will not accept an install from my iWork's 09 CD. How do I get around this?

    Hi, I'm helping StringSinger2 with this problem.
    The previously installed version is Pages 3.0.3 (the same as from iWork 08). This version (Pages 3.0.3/iWork 08) is incompatible with Pages 5.
    That is why it would be helpful to install iWork 09, which is the version between the two. It will open the older 08 files, and its saved files are readable by the new Pages5.
    SO...
    When I try to install iWorks 09 from my retail DVD the error message is "the installer is damaged". (I know the dvd is good, I installed iWorks09 to my laptop today.) Is the "installer" part of the system files? And - If that is damaged is there a patch for that?
    Many Thanks!

  • Double-click in Files panel will not open a file

    Double-click in Files panel will not open a file. Instead
    alert message appears (I will translate from Czech): "Design notes
    are not allowed for this file. If you want to use Design notes...".
    I do not want use Design notes, I want to open a file from File
    Panel.
    The same issue is when opening by right-click/Open. The only
    (and unconfortable) way to open a file from Files panel is to
    right-click/Open in program/Dreamweaver, this works.
    Do you know why? help me, please, this disturbs me very much.
    I have clean installation of up to date CS3 Design Premium
    (Version 9.0 build 41) on WinXP SP2. Previous version of DW (v8)
    worked fine in this way. Associations in system are set OK, I
    think, because double-clicking in my file manager really opens for
    examle PHP files in DW.

    Also Drag & Drop from Files panel is not functioning.
    Sometimes neither alert appears, simply nothing happen.
    Note: I am trying usual files like PHP or HTML files, but
    also others (PDF, CSS) with the same result - nothing
    happens.

  • An error occurred while opening the file, you can not open this file because it does not page???

    Dear all,
    i am test the report to show "No Data Found"  world, but, when i preview to PDF, i got  the message :An error occurred while opening the file, you can not open this file because it does not page.
    i try to load the other xml file that have data, and report work,no error.
    i don't know where is the problem, so i need some help....
    Thanks in advance for your response.
    my rtf report:
    <?call:header?>
    <?if:count(PLAN_CODE)>0?>
    <?for-each@section:G_PLAN_CODE?>
    <?template:Header?>
      <?for-each:G_PURPOSE?>
      <?end for-each?>
    <?end template?>
      <?for-each:G_PLAN_SUBSQL2?>
      <?end for-each?>
    <?end for-each?>
    <?end if?>
    <?if:count(PLAN_CODE)=0?>
    ====================No Data Found ===================
    <?end if?>
    about xml:
    if no data query back:
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <NARLGLR005>
      <LIST_G_PLAN_CODE></LIST_G_PLAN_CODE>
      <CF_START_DATE>102.3</CF_START_DATE>
      <CF_END_DATE>102.3</CF_END_DATE>
      <CF_TITLE_NAME>Company</CF_TITLE_NAME>
      <CF_OU_NAME>IT Department</CF_OU_NAME>
      <CF_SOURCE_CODE>N/A</CF_SOURCE_CODE>
      <CF_PRINT_DATE>102.11.18  15:48:10</CF_PRINT_DATE>
    </NARLGLR005>
    if have data:
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <NARLGLR005>
      <LIST_G_PLAN_CODE>
        <G_PLAN_CODE>
          <PLAN_CODE>03101C3003</PLAN_CODE>
          <PLAN_NAME>03101C3003_test</PLAN_NAME>
          <PLAN_EM>John</PLAN_EM>
          <PLAN_START_DATE>101.09.01</PLAN_START_DATE>
          <PLAN_END_DATE>102.08.31</PLAN_END_DATE>
          <PLAN_HOSTS>abc_super</PLAN_HOSTS>
          <LIST_G_PURPOSE>
            <G_PURPOSE>
              <PURPOSE_CODE>11600000</PURPOSE_CODE>
              <PURPOSE_NAME>Pre-Pay</PURPOSE_NAME>
              <LIST_G_PURPOSE_CODE>
                <G_PURPOSE_CODE>
                  <BUDGET_AMOUNT>0</BUDGET_AMOUNT>
                  <REAL_BUDGET_AMOUNT>0</REAL_BUDGET_AMOUNT>
                  <TEMP_RECEIPT_AMOUNT>0</TEMP_RECEIPT_AMOUNT>
                  <REAL_PAY_AMOUNT>0</REAL_PAY_AMOUNT>
                  <TEMP_PAY_AMOUNT>-83006</TEMP_PAY_AMOUNT>
                  <TEMP_PAY_FINAL_AMOUNT>83006</TEMP_PAY_FINAL_AMOUNT>
                  <TOTAL_AMOUNT>83006</TOTAL_AMOUNT>
                </G_PURPOSE_CODE>          
              </LIST_G_PURPOSE_CODE>
              <CS_BUDGET_AMOUNT>0</CS_BUDGET_AMOUNT>
              <CS_REAL_BUDGET_AMOUNT>0</CS_REAL_BUDGET_AMOUNT>
              <CS_TEMP_RECEIPT_AMOUNT>0</CS_TEMP_RECEIPT_AMOUNT>
              <CS_REAL_PAY_AMOUNT>0</CS_REAL_PAY_AMOUNT>
              <CS_TEMP_PAY_AMOUNT>0</CS_TEMP_PAY_AMOUNT>
              <CS_TEMP_PAY_FINAL_AMOUNT>0</CS_TEMP_PAY_FINAL_AMOUNT>
              <CS_TOTAL_AMOUNT>0</CS_TOTAL_AMOUNT>
            </G_PURPOSE>      
          </LIST_G_PURPOSE>
          <LIST_G_PLAN_SUBSQL2>
            <G_PLAN_SUBSQL2>
              <GL_DATE>31-07-12</GL_DATE>
              <NARL_DOC_NUMBER>0310107311004</NARL_DOC_NUMBER>
              <AP_UNAPP></AP_UNAPP>
              <PLAN_NAME1>03101C3003_101-102</PLAN_NAME1>
              <PLAN_CODE1>03101C3003</PLAN_CODE1>
              <PLAN_EM1>Elly</PLAN_EM1>
              <PLAN_START_DATE1>2012/09/01 00:00:00</PLAN_START_DATE1>
              <PLAN_END_DATE1>2013/08/31 00:00:00</PLAN_END_DATE1>
              <PLAN_HOSTS1>KIC-Supp</PLAN_HOSTS1>
              <REAL_RECEIPT_AMOUNT>0</REAL_RECEIPT_AMOUNT>
              <DESCRIPTION>101 year</DESCRIPTION>
              <CF_GL_DATE>101.7.31</CF_GL_DATE>
            </G_PLAN_SUBSQL2>
          </LIST_G_PLAN_SUBSQL2>   
          <CF_START_DATE1>99.1</CF_START_DATE1>
          <CF_END_DATE1>102.11</CF_END_DATE1>
          <CF_TITLE_NAME1>TCS Company</CF_TITLE_NAME1>
          <CF_OU_NAME1>IT Department</CF_OU_NAME1>
          <CF_SOURCE_CODE1>plan</CF_SOURCE_CODE1>
          <CF_PRINT_DATE1>102.11.19  17:12:19</CF_PRINT_DATE1>
          <CS_T_BUDGET_AMOUNT>517524</CS_T_BUDGET_AMOUNT>
          <CS_T_REAL_BUDGET_AMOUNT>517524</CS_T_REAL_BUDGET_AMOUNT>
          <CS_T_TEMP_RECEIPT_AMOUNT>289294</CS_T_TEMP_RECEIPT_AMOUNT>
          <CS_T_REAL_PAY_AMOUNT>289294</CS_T_REAL_PAY_AMOUNT>
          <CS_T_TEMP_PAY_AMOUNT>0</CS_T_TEMP_PAY_AMOUNT>
          <CS_T_TEMP_PAY_FINAL_AMOUNT>0</CS_T_TEMP_PAY_FINAL_AMOUNT>
          <CS_T_TOTAL_AMOUNT>228230</CS_T_TOTAL_AMOUNT>
          <CS_REAL_RECEIPT_AMOUNT>289294</CS_REAL_RECEIPT_AMOUNT>
        </G_PLAN_CODE>
      </LIST_G_PLAN_CODE>
      <CF_START_DATE>99.1</CF_START_DATE>
      <CF_END_DATE>102.11</CF_END_DATE>
      <CF_TITLE_NAME>Company</CF_TITLE_NAME>
      <CF_OU_NAME>IT Department</CF_OU_NAME>
      <CF_SOURCE_CODE>N/A</CF_SOURCE_CODE>
      <CF_PRINT_DATE>102.11.18  15:48:10</CF_PRINT_DATE>
    </NARLGLR005>

    Hi,
    You mentioned you tried some steps but I'm not sure what they are, you may try my suggestion to resolve this issue, follow these steps:
    Click Start, right-click Computer, click
    Properties, and then click Advanced system settings.
    On the Advanced tab, click Environment Variables.
    Locate and select the __COMPAT_LAYER variable, and then click Edit.
    Set the value of the __COMPAT_LAYER variable to EnableThemes. Or, delete the __COMPAT_LAYER variable.
    If the issue persists, we can troubleshoot this problem in Clean Boot to determine whether background programs are interfering with PowerPoint:
    http://support.microsoft.com/kb/929135
    Regards,
    Melon Chen
    TechNet Community Support

  • How can i setup pages to automatically open when double clicked.  Currently when I double click it creates cpgz file and does not open.  The only way to open pages doc is to manually ask to open with pages.

    Currently when I double click it creates cpgz file and does not open.  The only way to open pages doc is to manually ask to open with pages.

    Hi Karen,
    Sounds like OS X has lost the association between Pages and its files.
    Start by quitting Pages, then going to Finder.
    In Finder, locate a .pages file. Click on it (once), then press command-I (eye, not one) to Get Info.
    In the Info window that opens, expand the Open With section.
    In this section, click on the pop-up menu and choose Pages (even if Pages is already shown).
    Click the Change All button to associate all files with the .pages extension with Pages.
    Close the info window.
    Double click any .pages file to check that Pages will now launch and open the file.
    Regards,
    Barry

  • The Applications File Server could not open the file

    Hi All,
    We have shared appl_top between 2 nodes.
    When running concurrent request such as active user report, i got the following error:
    The Applications File Server could not open the file oXXXXX.out for read
    I have found metalink note
    The Applications File Server could not open the file o611681.out for read (Doc ID 1311372.1)
    The $APPLCSF are all fine and so are the permissions.
    I found out if i start my primary node first, wait till concurrent manager start, then start second node, it would be ok.
    is this recommended practice?
    i thought i can start up all node at the same time.
    am i right to say that the last node run adautocfg is the primary node?
    Thanks in advance

    I found out if i start my primary node first, wait till concurrent manager start, then start second node, it would be ok.
    is this recommended practice?Do you have PCP implemented? If yes, you do not need to start the CMs on the second node and running adcmctl.sh script on the first node would be enough.
    i thought i can start up all node at the same time.What exactly do you start?
    am i right to say that the last node run adautocfg is the primary node?Please explain what components are running on each node.
    All the URLs Accessing EBS Are Getting Redirected to the Web Node Where Autoconfig Last Ran [ID 1349509.1]
    Thanks,
    Hussein

  • Question: is it possible to recover an InDesign file that will not open. the problem came by copying a pictogram vector illustrator to indesign. My file indesign does not want to open it now. Thank you

    Question: is it possible to recover an InDesign file that will not open. the problem came by copying a pictogram vector illustrator to indesign. My file indesign does not want to open it now. Thank you

    You can try the script mentioned in #1 here: Re: InDesign 6 is crashing when attempting to open a particular document. All others are opening OK.
    Here's how to install a script: http://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-o r-blog-post.php

  • When trying to download a pdf, it only shows up as a 20kb file and will not open.

    When I try and download a pdf file or open it from a site, it only shows the file as 20Kbs, I know it is larger than that, and I can open other pdfs that are already on my computer. Just not new ones.

    Hi there!
    Try dragging the file you downloaded onto an open Notepad window. What do you see in Notepad then?

Maybe you are looking for

  • Bonjour service disabled after latest update

    I just updated my iTunes to the latest version and a message came up stating: Warning! The Bonjour Service has been disabled. Bonjour is required for sharing music with others, playing music through AirPlay speakers, connecting to Apple TV...."  then

  • Computer Freezes After iPhoto Album Mosaic Screen Saver

    After using the Mosaic screen saver, my Mac will freeze, therefore resulting in me having to perform a hard shutdown, and reboot my Mac. When my Mac turns back on and I log in, Crash Reporter reports that AdobeResourceSychronizer crashed. The log is

  • When will I get my paid?

    I put my app in store on 12 Sept. and I still didn't get any paid from apple. I can see my earnings on financial reports page. When will Apple make payment?

  • Problem to run forms

    Hello Everybody, I am getting following error message when I try to run a form: FRM - 90928: Positional parameter after key on command line. Any help will be highly appreciated. Thanks.

  • Can I output sd from hd video

    Most of the new video cameras are hd only. Can I input and edit hd video and then output sd, using encore to author a standard dvd?