How can I use wpg_docload.download_file and prompt the user to save it?

Hi,
Posted about this a couple of weeks ago with a text file and got the following code (where x.zip=x.txt) and it worked fine. Problem is that I need to do this with zip files, and when I run the code below, it simply displays the zip file, rather than prompting the user to save the file. Have tried every mime type under the sun. No joy.
The How to Upload and Download Files in an Application Advanced Tutorial for Release 3.2 does not work for APEX4. Simply creating a file browse item leads to Error ORA-20999: P3_FILE_NAME has to have a valid BLOB column as source. and so I cannot follow that tutorial to get further clues on how to make this work.
Susan
Thanks and here's the wpg_docload.download_file code that displays a binary file:
declare
lob_loc bfile;
v_length integer;
fname varchar2(100) := 'x.zip';
l_blob blob;
des_offset number := 1;
src_offset number := 1;
begin
lob_loc := bfilename('CELFILES_9906', fname);
v_length := dbms_lob.getlength(lob_loc);
DBMS_LOB.createtemporary(l_blob, FALSE);
dbms_lob.open(lob_loc, dbms_lob.lob_readonly);
DBMS_LOB.LOADBLOBFROMFILE(
dest_lob=>l_blob,
src_bfile=>lob_loc,
amount=>v_length,
dest_offset=>des_offset,
src_offset=>src_offset);
owa_util.mime_header('application/zip', false);
htp.p('Content-length: ' || v_length);
htp.p('Content-Disposition: inline; filename="' || fname || '"');
-- close the headers
owa_util.http_header_close;
-- download the BLOB
wpg_docload.download_file( l_blob );
DBMS_LOB.freetemporary(l_blob);
EXCEPTION WHEN OTHERS THEN
DBMS_LOB.freetemporary(l_blob);
RAISE;
end;

I downlod blobs like this without issue (using IE7 and FF):
owa_util.mime_header('application/octet', False);
HTP.p ('Content-length: ' || DBMS_LOB.getlength (l_blob));
htp.p('Content-Disposition: attachment; filename="'||v('P20_FNAME')||'"');
OWA_UTIL.http_header_close;
WPG_DOCLOAD.download_file (l_blob);
...Remember, that it's your browser's MIME type settings that determine whether to pop up a save diaglog box. In FF 3.6 > Tools > Options > Applications > Content type. The set action for each mime type.

Similar Messages

  • I have an external hard drive that is partitioned three ways. I have made an install disk out of one partition. How can I use this partition, and not the whole drive with bootcamp assistant?

    See title.
    When the drive is plugged in, boot camp assistant says that no installer can be found, but the application doesn't list the three separate partitions like finder/disk util does.
    I am using a mid-'12 retina mac running os X 10.9
    Hopefully this is an easy fix.
    Thanks in advance.

    Hello,
    I have just experienced the same thing!
    Although my external drive shows in Disk Utility, it does not show in Finder.
    And the Verify/Repair buttons are also greyed out.
    Also, although the drive is 2TB. DU shows it as having Total Capacity of only 4.14GB! (Which should be the Free Space).
    I was wondering if you solved your problem, & if so, would you share your solution.
    I´m afraid to Erase in case I lose all my Data on the drive.
    Thanks in advance for your reply!

  • 1. I have an iPod which has purchases synced with I tunes with an apple ID. I now have an iPad with a new ID for cloud. I have cloud storage capacity of 5gb which came with the iPad. How can I use one ID and store my existing music in cloud?

    1. I have an iPod which has purchases synced with I tunes with an apple ID. I now have an iPad with a new ID for cloud. I have cloud storage capacity of 5gb which came with the iPad. How can I use one ID and store my existing music in cloud?

    HI Frostyfrog
    CHeck out iTunes Match which has an annual fee of £21 or thereabouts. You can store a maximum of 25,000 songs there and they all become available on your other kit, iPhone, iPad and iPod. I know it works as I have over 23000 songs uploaded of which only a few we're bought through iTunes.
    it works by comparing your music to the whole iTunes music dadata base so you access the same tunes that you could get from iTunes. If you have obscure stuff, it uploads your own music to the cloud as a copy.
    I Find it incredible that on my iPhone with its 16gb memory I can view almost 200 gb of music (ie my 23000 songs) and play any of them. Anything I add to iTunes becomes available via the cloud fairly quickly from a few minutes or a little longer if adding a lot.
    The first time you use it it will take quite a while to match your music if you have a lot, but after that it is all automatic. Read the stuff on the apple site. Your PC needs to be at least running Vista. I recommend it and at less than 50p a week it's good value.
    Good luck

  • How can i use this sript and loade another movie?

    Hi there, i used the following script to load a movie from the server;
    var request:URLRequest = new URLRequest("url string");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    How can i use this sript and loade another movie? Can someone help me please?
    [edited by moderator]

    Sir, I changed it from:
    var request:URLRequest = new URLRequest("http://agusandelsur.gov.ph/downloads/pdrrmo/agusan_del_sur/StaJosefa/Movies/Dir.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    to
    var request:URLRequest = new URLRequest("http://agusandelsur.gov.ph/downloads/pdrrmo/agusan_del_sur/StaJosefa/Movies/Warning.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    When i expord the movie i get the following error.....
    Scene 1, Layer 'Layer 3', Frame 1, Line 6    1151: A conflict exists with definition request in namespace internal.

  • I am going overseas to Singapore how can I use my ipad2 and my iPhone without it costing me a fortune. I am in Australia

    I am going overseas to Singapore how can I use my ipad2 and my iPhone without it costing me a fortune. I am in Australia

    iPhone - Locating wireless carriers
    The above will provide carriers in Singapore that you can use. You would get the SIM card from the carrier. Of course if you are somewhere that has WiFi service then you won't need the cellular connection.

  • How can i use PCIe 1433 and basler line camera to construct image and pocess it?

    hello! every one ,I am new to machine vision.i have two problems to ask.First,how can i use line camera and 1433 to acquire 2-D image?second,if i want to pocess the 1-D signal ,how can i do it ?i expect for your answer ,thank you!

    What you are trying to do is not something you can easily do in a forum, but I can give you the basics.
    You have a CameraLink frame Grabber (PCIe 1433) and a LineScan Camera
    The framegrabber needs to be configured to understand how to communicate with the camera.  You need a file from the camera vendor.  This file might already be installed.  You can use MAX to check if it is, under Devices/IMAQ.
    Assuming you can get to the point where you can communicate with the camera, you need to configure your acquisition.
    Since the camera is a line scan camera, it captures image data one pixel ine at a time.  You will need to configure the frame grabber to determine how many lines per image you want.  The low limit is usually 1, and the high limit is either based on the framegrabber's internal memory, or that of the computer.
    If you are using labview, you will need to open a sessing to the camera, acquire the image(s), and then close the session when you are done.
    Once the image(s) are captured, you can performa analysis using the NI Vision Toolkit.
    Sorry, but there is no way to condense years into one post.
    Machine Vision, Robotics, Embedded Systems, Surveillance
    www.movimed.com - Custom Imaging Solutions

  • How can I use wget, cron and Automator to periodically pull a dynamic image from a URL to local storage, and then update a Keynote slide with that image, automatically?

    How can I use wget, cron and Automator to periodically pull an image from a URL (which is dynamically updated - like a weather map, say - to local storage, and then update a Keynote slide with that image, automatically?

    Any particular reason for those specific technologies?  wget does not exist on a mac, although you can nstall it I guess.  OS X has curl installed which should do pretty much anything you want to do with wget.  cron is being replaced by launchd, although cron still exists on mountain lion.
    As far as I can tell from automator all the standard 'actions' to access keynote  available to it require keynote to be open and running, but does not provide a function to actually open it.  So I think you will have to write some applescript, as a minimum to open and quit keynote. I notice that the keynote actions are mostly circa 2005 an wonder if they would even work.
    Under utilities in automator 'actions' there is a capability to add applescripts as part of the workflow.
    Also, note that cron is being dprecated by Apple and replaced by launchd.  that said cron is stil on my mountain lion instalation.
    This entry at stackoverflow shows use of cron with curl to get web urls.  http://stackoverflow.com/questions/1683620/getting-started-with-cronjobs-on-a-ma c
    If I have any time I may try and get this to work as it is quite interesting and new to me.  But otherwise, good luck.

  • How can i use both Windows and Mac os at the same time on my iMac

    How can i use both Windows and Mac os at the same time on my iMac

    You can use Parallels desktop or VM Fusion to run both operating systems at the same time. Both programs work well, but I personally perfer VM Fusion.

  • How can i use my apple ID with the itune store over my windows laptop

    how can i use my apple ID with the itune store over my windows laptop

    If you don't have iTunes installed on your laptop then you can download and install it from here : http://www.apple.com/itunes/download/
    You can then log into your account on it via the Store > Sign In menu option (on iTunes 11 on a PC you can get the menus to show via control-B) :
    And you can then select the Store on the left-hand sidebar (you can enable the sidebar via control-S), and then browse items in the store and buy them by clickin on their price.

  • Hi, we have two iphones with two accounts.  The apple tv automatically syncs with one account to play music from the iphone to apple tv.  How can I use my iphone to do the same?

    Hi, we have two iphones with two accounts.  The apple tv automatically syncs with one account to play music from the iphone to apple tv.  How can I use my iphone to do the same?

    Our experience is a little different, we have different iTunes accounts for different family members, each family member has their own iTunes library on their own mac, each mac uses my Apple ID for homesharing and we are able to play purchased content from each library on the Apple TV.

  • HT1660 how can I use one single library for all users on the same laptop?

    how can I use one single library for all users on the same laptop?

    You are most of the way there. Each user having access to hard drive is the key. If users are limited in file privileges this is harder.
    Any files you add to your library and any files she adds to her library are available to the other. Just not automatically. Each user must add the files to their own library using the add file or add folder option from menu bar.
    What I have done is set library location to a location outside of My Documents\My Music. On my network storage I have a folder names s:\itunes. Both accounts iTunes are set to use this location for the library.

  • Hi, I am trying to download IOS7 to my ipad. The programme has locked at the 'Choose a Wif-Fi network' page, a box says 'joining other network' but the page is greyed out and can't move from it.  How can I clear this screen and finish the download. Thanks

    Hi, I am trying to download IOS7 (not sure if it's 1 or 2) to my ipad. The programme has locked at the 'Choose a Wif-Fi network' page, a box says 'joining other network' but the page is greyed out and can't move from it.  How can I clear this screen and finish the download. Thanks

    Hello Den53,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430?viewlocale=en_US
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    After the device has turned off, press and hold the Sleep/Wake button until the Apple logo appears.
    Best of luck,
    Mario

  • [HELP],875P LSR ,HOW Can I USE 3 Optical Drives in the MoBO?

    I have 1 SATA HDD Drive (Seagate 160G) installed and Have 3  Optical Drives ,Pioneer DVD and Liton CDRW in IDE2 , Plextor CDRW in IDE3 ,but MOBO can't recgnize the PLextor CDRW,WHY???
    NEED HELP!!!!!HOW can I USE these 3  Optical Drives the same time?THANK's LOT!

    Thanks Everybody!
    I changed another IDE Cable and set IDE mode in BIOS : Native , SATA only ,Keep PATA, both channels
    then,
    Everything is OK!
    How silly I am ! I used a bad 80 pin IDE CABLE!

  • How can i uninstall Windows 7 and remove the partition?

    how can i uninstall Windows 7 and remove the partition?  white unibody late 2009.  i cannot seem to find bootcamp either :/

    Open the Boot Camp Assistant in the /Applications/Utilities/ folder and use it to restore the drive to a single partition setup. If it's not there, use Pacifist to extract it from your install DVD and run the combo updater for your OS version.
    (79308)

  • How can I use apple gift card in the Philippines . It says it's only applicable in US storefront

    How can I use my gift card in the Philippines  when it says for US Storefront only

    You cannot use that card. iTunes gift cards are only valid in the country of original purchase.

Maybe you are looking for

  • Trying Trial Version: How do I open a file to edit?

    I managed to do this somehow a week ago. Now the program only recognizes files I have previously imported. It will not allow me to search folders on drive to select individual photos.  At present, The only file folders it recognizes are those I initi

  • 5th generation ipod is recognized by computer but not by itunes.

    Every time I try to sync, iTunes doesn't respond. I just get the spinning beach ball and I must force quit. The computer recognizes the ipod but not Itunes. Both work fine independent of each other.

  • Acrobat XI Pro crashing when changing highlighted text properties

    After install update 11.0.07 EVERY after highlighting a section of text and attempting to change the properties the program crashes, this is happening in ALL my documents with highlighted text Here is what I see, first screen shot is a PDF file that

  • IPhone 4S not working

    Issue with my iphone: itunes was displaying iPhone unresponsive, so performed Erase All Content And Settings from settings app. Now its been a long time and the screen is showing spinning wheel. Please help

  • Use Wifi to download updates

    I watched my Nokia Lumia 920 update three apps tonight. Two of the updates used the phone's cell network. One update used wifi. Is there a setting on that I can set to make the phone only use wifi to download updates?