Wpg_docload.download_file to download a zipped file...not working

I am working with APEX 4.1
Within the application being developed, it is a requirement to be able to select multiple rows within an interactive report, then click a button to download these as a ZIP file.
Currently, a field is populated that contains a colon-delimited list of ID values to determine which rows to download, like ":17:127:"
Upon submitting the page files are chosen and zipped through a process, then downloaded through the same process.
Here is the PL/SQL process for zip and download:
declare
  g_zipped_blob blob;
  b_dl_file BLOB;
  v_filename VarChar(1000);
begin
for rec in ( select FILE_ID, FILENAME, FILE_BLOB
from DD_FILES
where instr(:P9_FILE_ID, ':' || FILE_ID || ':') > 0)
LOOP
  zip_blobs.add1file( g_zipped_blob, rec.FILENAME, rec.FILE_BLOB );
end loop;
  zip_blobs.finish_zip( g_zipped_blob );
  select sysdate into v_filename from dual;
  owa_util.mime_header( 'application/octet', false );
  htp.p('Content-length: ' || dbms_lob.getlength(g_zipped_blob));
  htp.p('Content-Disposition:  attachment; filename="'|| v_filename ||'.zip"');          
  owa_util.http_header_close;
  wpg_docload.download_file(g_zipped_blob);
--dbms_lob.freetemporary( g_zipped_blob);
end;add1file and finish_zip are stored procedures.
Currently upon pressing the button, nothing happens(but the page is submitted, nothing seems to happen), although when testing the process, it returns what appears to be a text version of the BLOB (within the SQL commands section of the SQL workshop).
Any reasons why this would be happening?
Already posted this in the PL/SQL section but it seems to have been ignored.

Hi,
Rather than submitting the page I would try opening a new page (for example, by calling popUpNamed) passing the ids as a parameter to this page. Then have your download process as a before header process on this page.
Use apex_application.g_unrecoverable_error := TRUE; at the end of your code to ensure that none of the page processing for this page is actually run.
Rod West

Similar Messages

  • Firefox insists on downloading a zip file with an application. Options is set to ask for download loaction but does not work

    When downloading a ZIP file I get a 'Launch Application' window.
    In Options I have set download to ask for a location and use the download window but this does not work.
    cannot find any way of changing this and there is no option for using an application.
    If I down load in IE I have no problems so it must be FireFox and not a system problem.

    I have found the problem.
    A download manager had been installed for a specific website and it was butting in all the time. Even after removing it with 'Add or remove software' it still had its hooks into the system and it was impossible to download anything as it now would not run.
    Had to do an XP 'System restore' before I could get rid of it.
    The offending program was MD_setup.exe size 3,045KB from the themediadownloader.com

  • I downloaded a .zip file. It ate up my space and i cant find the file. How do i get this file off my phone?

    I downloaded a .zip file. It ate up my space and i cant find the file. How can i get this file off my phone?

    Not possible. Safari won't download and save a Zip file. You either had to use a 3rd party app, or as wjosten suggests, your phone is jailbroken. If the former, you'll need to use that app to find it. If the latter, you'll have to look elsewhere for assistance.

  • I've downloaded a zip file from noisetrade, but it won't open on my mac...what shall I do?

    Hey guys, wondering if someone could give me some help. I've downloaded a zip file from noisetrade, but it won't open on my mac.I keep clicking and it vhanges to a cgzp file..and even when I changed the end bit to zip, it won't open. I've tried the unarchive app andthat hasn't worked either...what shall I do?
    Thanks in advance :-)

    iWork (no 's') for iOS & iWork for Mac have not gone away.
    iWork.com (beta) (also no 's') is going away the end of July. iWork.com (beta) is/was an online method of sharing iWork files with other users & never moved out of beta in 3+ years. It is a completely different entity than the iWork apps & is not & never has been necessary for the iWork apps to function.
    A Numbers document, as well as Pages or Keynote documents, cannot be opened on a PC. You must first export them to a file that a PC can use. For Numbers that is generally Excel. In Numbers on your iPad tap the wrench & then tap Share & Print & choose Excel as the file type.
    As for transfering a file from a PC to an iPad, I'm not sure as I don't use a PC.

  • I get an error message 7-Zip file not found

    When I am trying to download Mozzila I keep getting an error message that states 7-Zip file not found and it won't let me download the browser.

    Hello psimonsen, you don't need 7-zip program to download official firefox, see: [https://support.mozilla.org/en-US/kb/install-firefox-windows Install Firefox on Windows]
    another official link : http://www.mozilla.org/en-US/firefox/all/
    thank you

  • Finder crashed after downloading a zip file with pictures

    First my desktop icons disappeared. Then the finder, appears and disappears every 3 seconds. Simultaneously the Finder also disappears and reappers in the "Force Quit Application" window. This started after I downloaded a zip file with family photos from a friend (on a windows machine). Rebooted off the Tiger installation dick. Running disk utility off the Tiger installation disk did not help. Permissions were repaired but the finder is still crashing Tried relaunching the Finder from the "Force Quit Application" window. No help. Ran Virex (outdated by 12 months) without any benefit.
    Any suggestions would be appreciated.

    There's a shameful glitch in Finder where if you drag certain attachments off a mail document onto the Desktop the Finder will do its quit/relaunch jitter bug--will also do it for illegally named files on the Desktop, and will hang for dang near forever it you accidently drop 100s of files onto the Desktop. The easy solution is to start the affected machine in target disk mode, hook it up by firewire to another Mac, then navigate to the affected user's Desktop folder and move the funky file or files into a new folder.
    Francine
    Francine
    Schwieder

  • Need to download MDM71500_ENRICHMENT_CONTROLLER.zip file for EC scenario.

    Hi All,
    Does anybody can tell me that where I can find SP05.ZIP file to download?
    I need to download MDM71500_ENRICHMENT_CONTROLLER.zip file object for an enrichment scenario.
    And SP05.ZIP file is not available in SMP(SP 02, 03 ,04 ZIP files and SP 05.SCA files are available in SMP).
    Regards,
    Nirmala.

    Hi Nirmala,
    Since SP05 release, The Enrichment Controller isn't delivered as a ZIP file. The content is now divided. The EC deployment file is located where you suggested (in the EC application download section) and the rest of the package is delivered with MDM business content package and it contains the simulator repository and all the extra content for the Customer and Vendor repositories, in addition you can find there the sample XML and matching XSD files. if you intend to develop an adapter you'll be able to find a sample adapter as well.
    Best Regards,
    Ran

  • Camera Raw 5.1 downloaded and unzipped but not working in CS4. Can't open Nikon D90 NEF files.

    Camera Raw 5.1 downloaded and unzipped but not working in CS4. OS Windows 7. Can't open Nikon NEF files. Camera Nikon D90.

    update the adobe program that needs cr 4.6+,  http://www.adobe.com/downloads/updates/

  • Can't download the zip file

    I have been trying to download the zip file all day today and keep getting a "Page Cannot be displayed". Is the file available today?
    Please use this forum to provide feedback about OTN content/services. All other posts will be DELETED.

    OS X Mavericks: Open an app from an unidentified developer

  • How to zip a folder containing subfolders with files and download the zip file in silverlght 4

    private void hbtnDownloadReceipt_Click(object sender, RoutedEventArgs e)
               try
                    string Docpath = "ClaimsDetails/" + "20tech" + "/" + PaymentAdviceUNo;
                    string dd = "ClaimsDetails/";
                    Uri uri = new Uri(Application.Current.Host.Source, "/" + Docpath);
                    Uri uri1 = new Uri(Application.Current.Host.Source, "/" + dd);
                    string path = uri.AbsoluteUri.ToString();
                    path1 = uri1.AbsoluteUri.ToString();
                    //HtmlPage.Window.Eval("window.open('" + path + "')");
                catch (Exception ex)
                    ex.Data.Clear();
    1) Here "path" is D:\\TL 24-12-2014 \\OfficeConnect_17_10\\OfficeConnect.Web\\ClaimsDetails\\20tech\\PaymentAdviceUNo.     
    2) In path "PaymentAdviceUNo" is the folder containing subfolders which i want to zip.
    Thanks in Advance.

    Hi,
    You can download a zip file like any files with the Webclient class, look at the details and examples in the msdn documentation for downloading content on demand it even talks about how to download and get a specific file from a zip archive.
    http://msdn.microsoft.com/en-us/library/cc189021(VS.95).aspx
    Besides,  if you want to list the files,you could check articles below:
    http://blogs.msdn.com/b/blemmon/archive/2009/11/25/reading-zip-files-from-silverlight.aspx
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem on downloading a zip file

    I am having a problem on downloading a zip file(file size is about 2Mb). Sometimes I can get a complete file and can open the file, sometimes the zip file is chunked(the file size is smaller than the right one), so I can't open it.
    The file content is stored in a blob field. The code first goes to database get the blob as inputstream, then copy the inputstream into response.getOutputStream().
    The problem is unpredictable. Even for the same blob data, sometimes I can get working file, sometimes I just get crapped file.
    Could somebody help me out? I am struggling with it.
    Any input is appreciated!
    public class DownloadTextAction extends Action implements Serializable{
        private static Log log = LogFactory.getLog(DownloadTextAction.class);
        public ActionForward execute(ActionMapping mapping, ActionForm form,
                                     HttpServletRequest request,
                                     HttpServletResponse response) throws Exception
            ActionErrors errors = new ActionErrors();
            String batch_id = (String)request.getParameter("batch_id");
            String fileName = batch_id+".zip";
            try
    //          response.setContentType("application/octet-stream");
              response.setContentType("application/download");
      //        response.setContentLength(content.length());
    //          response.setHeader("Content-Disposition", "inline; filename=\""
    //                    + fileName + "\"");
              response.setHeader("Content-Disposition", "attachment; filename=\""
                        + fileName + "\"");
              InputStream in = untilService.getBlob(batch_id);         
              OutputStream out = response.getOutputStream();
              FileHelper.copy(in, out);
              out.flush();
              in.close();
              out.close();
            catch (Exception e)
              errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.detail", e.toString()));
              saveErrors(request, errors);
              log.error(e.toString());      
            return mapping.findForward(Constants.SUCCESS);
        }

    Maybe a fault in the missing FileHelper.copy() method?

  • How can I fix error code 131:4? Licensing for this product stopped working. I have windows vista home edition and CS4 Design Premium. I downloaded licensing zip file for windows but I can't seem to get it to launch. Look forward to help from anyone

    How can I fix error code 131:4? Licensing for this product stopped working. I have windows vista home edition and CS4 Design Premium. I downloaded licensing zip file for windows but I can't seem to get it to launch. Look forward to help from anyone

    Steve,
    I appreciate your answer.  While it might work, I'm a bit hesitant to remove the other programs as a possible solution since they are all currently working.
    With Acrobat 9 Pro failing with the OS 10.7 upgrade, I'm hoping that there is a less severe solution.
    Since the trigger appears to be 10.7 and may have something to do with the discontinued support of Rosetta, I could be spending a few hours working on a reinstall without a change.  Yes, it might work.  The "might" is the part that makes me hesitate.
    Is anyone else out there on OS 10.7 and running Acrobat 9 Pro?  Any issues with anyone else?
    Thanks Steve.  I do appreciate your offering a solution.  I may end up trying it if nothing else comes together.
    Mark

  • No luck trying to extract .inf files from drivers downloaded as zip files

    Hi,
    I am trying to extract .inf files from drivers downloaded as zip files from the Toshiba website, but I'm having no luck.
    I am trying to deploy images using WDS on server 2008 and need the inf files for this to succeed, does anyone have the answer to this problem.
    thanks in advance.

    Hi
    I found this tip:
    Someone wrote this:
    +You have to run the installer, wait for it to get to the first point where you click Next to continue, and then leave it sitting there. Go into your system's Temp and find the particular one with the installation files inside it that were extracted, then copy it someplace, go back to the installer and cancel it.+
    You could also try this freeware application to extract the package:
    http://www.legroom.net/software/uniextract

  • Downloading attached zip file from emails using safari

    How to download, and where will be the downloaded attached zip file in email be stored using safari? How to open and save the zip file attached to the email? Do you need an app to open and store the zip file?

    The app GoodReader (I don't know if there are any free apps that can also do it) can be used to zip and unzip email attachments
    press and hold the zip file in your email - after a couple of seconds you should get a popup, with one option being 'Open in GoodReader' which you should select
    GoodReader should then open with the zip file listed under My Documents
    select Manage Files on the right-hand side of GoodReader, select the zip file, and touch the Unzip button that appears on the right
    You should also be able to download zip files directly into GoodReader by typing the URL in its Wed Downloads sectio.

  • Fusion Order Demo zip file which works with JDeveloper 11.1.1.3.0

    Hi,
    Please can anyone tell me where to find the Fusion Order Demo zip file that will work with JDeveloper 11.1.1.3.0 (latest version 13/5/10).
    I have downloade OracleXE 10g for Windows on my laptop and now want to create the Fusion Schemas (Tables/Schemas/Procedures etc) for the Demos.
    I have downloaded FOD_11.zip, FusionOrderDemo_R1.zip and tryed the instructiion for running Fusion Order Demo here http://www.oracle.com/technology/documentation/jdev.html but each time I get the error
    "oracle.javacache_11.1.1 not found"
    How can I fix this?
    I want to learn Jdeveloper works and use it for Logical and Physical Schema mapping....
    Thanks
    BP

    Hey John,
    Thanks for the quick reply, and yes sir, I did follow those instructions.
    Let me describe what all I have done so far, maybe someone can figure out where I need to fix anything:
    I installed JDeveloper version 11.1.1.3.0, which came with its own WebLogic server, on my windows xp professional OS on my laptop.
    I then downloaded the zip file, FusionOrderDemo_R1PS2.zip.
    I encountered a problem while unzipping the file, where it was asking me some password for a few files, but Lynn from Oracle helped me figure that out....i had to use 7-zip utility to uninstall....windows default built-in unzip utility does not work.
    After unzipping all files, I followed the instructions given on http://www.oracle.com/technetwork/developer-tools/jdev/index-095536.html to import, build and run the application....
    And now when it runs....it just open my browser window (IE 7), and shows a "loading..." image in the center of the page....nothing happens after that.
    Any idea what might be missing?
    a few major errors I see in the wls log window of jdeveloper are:
    1) <DCBindingContainer><reportException> [3952] oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLDataException, msg=ORA-01882: timezone region not found
    2) <DCBindingContainer><reportException> [3958] oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
    3) <UIXInclude><tearDownVisitingContext> Tear down of include component context failed due to an unhandled exception.java.util.NoSuchElementException
    Please help!
    Regards,
    Hemant

Maybe you are looking for

  • Camera roll does not transfer to new iPad

    Camera roll photos in iCloud do not load on new iPad. Only photo stream does. I've reset New iPad twice

  • I am trying to restore from a backup without factory resetting the iphone

    I am trying to restore from a backup but do not feel comfortable factory resetting the phone.

  • IPhoto 08 crashes when viewing photos

    Hi, I'm using iPhoto O8. I have about 4000 photos in the library. I'm using this on an intel iMac. All has been working fine. However, it has now decided to crash if I try to view a photo. The programme will open fine and I can see the thumbnails for

  • Network connection reset error

    I am struggling to effect any software updates or downloands.  I get a "network connection reset" error.  I have failed to update iPhone software, even YouTube videos seem to hang at about the 50% mark.  I do not have anti-virus and have inserted new

  • FileReference.download in linux

    Hi All      I am developing an application to use in both linux(ubuntu) and windows.      In that i am using FileReference.download to save the file locally in windows but this is not working in linux.      Is there any other possibilities(method) to