Download file using wpg_docload doesn't work

Hello All,
I am creating a web page that uploads and downloads files. Oracle table that stores BLOB content and type is working fine.
Upload works fine. When I download file, it opens in the same browser and same tab instead of opening in 'Save As' dialog box . The code is as below:
IF params('submit') ='Download' THEN
SELECT mime_type, dbms_lob.getlength( blob_content ), blob_content
INTO s_mime_type, n_length, lob_cont
FROM rowan.FILE_UPLOAD
WHERE name=params('txtFilename');
-- Set the size so the browser knows how much it will be downloading.
owa_util.mime_header('text/plain', FALSE );
htp.p( 'Content-Length:' || n_length );
-- The filename will be used by the browser if the users does a "Save as"
htp.p('Content-Disposition: attachment; filename="'||params('submit')||'"');
owa_util.http_header_close;
-- Download the BLOB
wpg_docload.download_file( lob_cont );
--htp.showpage ();
END IF;
Thanks,
Himadri.

Your SQL select statement includes the column mime_type.
The HTTP header that is created by your code, sets the Mime type as follows:
owa_util.mime_header('text/plain', FALSE );
So.. the file could be binary, could be an image - and this code tells the browser that the data in that HTTP response is in fact plain ASCII text.
Obviously the browser will choke on that HTTP response as the content is not ASCII text. And it will use the application that is associated with Mime type text/plain to receive that response. By default, that is the browser itself. So it will open a new rendering window/tab (or use the existing one) to display this "text" contents that is expects to receive.
Change that statement in your code to:
owa_util.mime_header(s_mime_type, FALSE );

Similar Messages

  • My new iPad air is suddenly asking for a pass code. I have only just finished restoring it from my iPad 2 and I didn't set one. The one I used before doesn't work. What can I do?

    My new iPad air is asking for a pass code. I have only just finished restoring it via iTunes from my ipad2 and I didn't set one. The one I used before doesn't work. What can I do?

    http://support.apple.com/kb/HT1212

  • I've had my ipod shuffle (2nd generation) for a long time now and after a year and a bit of not being in use it doesn't work. When I connect it to the computer it doesn't come up. Can my ipod be charged or fixed?

    I've had my ipod shuffle (2nd generation) for a long time now and after a year and a bit of not being in use it doesn't work. When I connect it to the computer it doesn't come up. Can my ipod be charged or fixed? Please help!

    That is about normal. You can maximize battery life by changing some settings. See:
    Apple - Batteries - iPod
    Apple will exchange your iPod for a refurbished one for with a new battery for $79. They do not fix yours.
    Apple - iPod Repair price                       
    A third-party place like the following will replace your battery for less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    Replace the battery yourself if you are up to it. You can purchase a replacment for about $10
    iPod Touch Repair – iFixit                  

  • Minimum version required to upload and download files using Netweaver Gateway

    What is the minimum service pack required to use the feature of Upload and download files using netweaver gateway. I already have a SP05

    Hi,
    as per this blog How to Read Photo from SAP system using SAP Gateway this should be possible with SP05.
    also refer How To Upload and Download Files Using SAP NW Gateway SP06
    Regards,
    Chandra

  • Why is my diabled login greyed out after i unlock it? I have tried to remove the library file but it doesn't work

    Why is my diabled login greyed out after i unlock it? I have tried to remove the library file but it doesn't work. It worked the first time and than all of a sudden it was greyed out.

    Where do you see a disabled login? In system preferences? In Login screen?

  • Got M-Cell that gives 5 bars, got full-strenth wifi, Internet on phone doesn't work, any app that uses internet doesn't work, seems like its started when upgraded to 7.1.1

    I have an AT&T M-Cell that gives 5 bars, got full-strenth wifi. Same wi-fi that my computer uses, that my Kindle uses.  So not capacity issue. but my Internet on phone drops out continuously and frequently, any app that uses internet doesn't work at all. It seems like it started when I upgraded to 7.1.1  I have connectivity like crazy, so why doesn't the internet work?

    Reboot your router by powering it down for 30-60 seconds.

  • HT204382 I just bought Quicktime MPEG - 2 to play MPG video files and still doesn't work. any suggestion?

    I just bought Quicktime MPEG - 2 to play MPG video files and still doesn't work. any suggestion?

    Please note:
    If your Mac has OS X Lion, MPEG-2 functionality is built in and the QuickTime MPEG-2 Playback Component is unnecessary.
    QuickTime MPEG-2 Playback Component for Mac OS X - Apple Store (U.S.)

  • How do i download files using other downloader (like orbit downloader) instead of firefox downloader itself?

    how do i download files using other downloader (like orbit downloader) instead of firefox downloader itself?
    please give me detailed steps to do it
    i have orbit downloader

    I tried it again, and this time when I resumed it lost about 10Mbytes, so I guess this means that the app store downloader saves its data every 10MBytes.
    I will try downloading the whole thing again(XCode4) and just hope that this time I can get the whole download before it decides to wipe out what it has already downloaded.

  • File download "save as" function doesn't work correctly

    I am using Firefox 24.3.0 ESR on Linux LXLE 12.04.3. I have problems downloading some files from some sites. After some investigation I found that the files have been given the generic MIME type octet-stream by the server. Presumably this is to encourage me to download the file rather than have it open automatically in the browser.
    For instance, if downloading one of these files that is a pdf file, left click gives me the standard box that allows me to choose to open the file in the default application or "save as". Once I do the left click, I can see that the file immediately starts to download in the background (network activity). If I wish to open it in the default application, it works. The green download arrow flashes and eventually the default application opens with the downloaded file when the download is complete. The download is then listed in my download library.
    If I select "save as" and my preference is set to download files to a fixed directory, it ignores the directory they should go to and places them in my home directory. The green download arrow flashes and again records the download in the download library.
    If I set the preference to "always ask me where to save files" then when I click on "save as" nothing happens. The green download arrow doesn't flinch and nothing appears in the download library.
    After hunting around I found that the file has actually downloaded to my /tmp directory. Clearly that was the background activity mentioned above. The name of the file in the /tmp directory is made up of seemingly random characters and I can retrieve it from there but this isn't exactly ideal and I would like this to work the way it is supposed to. i.e. I want to be able to click on "save as" and select where I want the file to be downloaded to (and it to go there).
    What could be causing this behaviour and how do I get the "save as" function to work?

    jscher:
    Thanks. The /tmp and home directories are on the same partition as the main operating system. The Downloads directory is actually set up as a sub-directory of the home one but is a symbolic link to a NAS drive. It works fine for other MIME types. It is just when web sites use the application/octet-stream MIME type that I get this problem.
    I checked the permissions and the /tmp and Downloads directories have full read write permissions for everyone. The home directory is the one with the restriction that only I can write to it.
    So, I don't expect that sheds any light on the problem.
    cor-el:
    Thanks. I meant to say in my first post (but pressed the button before it got in) that I actually created a completely new Firefox profile and the problem is still there. Sorry, I should have included that.
    The only difference with the fresh profile is that the "open in default application" isn't available, presumably because no default application has been assigned. The "save as" behaviour is still the same.
    So, if the problem exists in a pristine profile, it looks like there is something deeper wrong.

  • Firefox doesn't download files using Download Helper

    When I use the "add-on" Download Helper icon to select a video file (FLV) for download, I'm asked which folder it should go into (as usual). But when I click "Download," the file never appears to start downloading. The number in parentheses next to the icon indicates that one file is in the queue, but in right-clicking and then checking the download queue, no files are listed. And then it sits in that configuration forever. No file ever appears anywhere on my system.
    The destination folder is present and accessible.
    This was a sudden change as of this morning, with no updates to any of my software or apps. I tried refreshing Firefox (v. 36), and I've tried disabling/deleting/reinstalling Download Helper (version 4.9.24) with absolutely no change in these circumstances. It does me no good to open Firefox in safe mode, since then Download Helper isn't enabled and therefore is untestable.
    Any ideas?

    Video DownloadHelper 4.9.24 doesn't work properly in Firefox 36. They are working on a new version and have posted a test version you can provide input on. See:
    * Test version site: https://groups.google.com/forum/#!forum/video-downloadhelper-5
    * Info from the developer: https://addons.mozilla.org/firefox/addon/video-downloadhelper/ ("We are aware of downloading issues when using Firefox 36.")

  • How do you save data into an excel file while myRIO is acquiring data? I tried saving it using "Write to file" but it doesn't work for some reason.

    I am acquiring cosine wave and a pulse wave as input and I want to store their peak to peak values into an excel file. "Write to File" is not working for it. Is there any other vi which can be used for data logging?
    Thank you for your help.

    Hi Ssheoran,
    Can you provide more detail when you say that the Write to File VI doesn't work? Is there an error given? Or can you just not find the file on your computer? Keep in mind using this file in a Real-Time VI on the myRIO will save files on the myRIO. You will then have to transfer to your PC. Please view the following video as a guide for saving files and transferring them to your computer: (http://www.youtube.com/watch?v=BuREWnD6Eno). Hope this helps.
    Best Regards,
    Roel F.
    Applications Engineer
    National Instruments

  • Find files in folder doesn't work

    To make my photo galleries, I use CS5, because this is the last version that can use modified galleries that I was able to since CS3.  My modified pages have links to other pages on my web site, while the ones that now come with Photoshop are dead end with no links.
    So, another feature lost in later Bridges is the ability to show ALL the contents of a folder and its subfolders.  To get around this, I choose to show folders whose metadata or filename DO NOT contain zzz, since none do.  This has worked fine and I have made hundreds of galleries from my phylogenetic folder trees of species.
         Until I came to this gallery of Tachinidae. I have been updating all my Arthropod species galleries  After I did the usual procedure, and created the gallery (and deleted the previous gallery both on my PC and the web), I noticed that the first image was a Belvosia, and there were non of the Archytas or other species that should have come before, alphabetically.  I tried again and found that it was ignoring a lot of files in some subfolders that should have come up.  I tried other finds, like all files ending in .tif, or all that had the keyword Tachinidae, and always the same result.
         Then I tried the same search in CS6 and it finds all, but of course I can't make my galleries here,  I went back to CS5 and made a new folder TACHINIDAE 1  and moved all the files there and tried again, with no success.  I tried a backup file with the same result.  Rebooting didn't help.
         Today I tried again and as it did the search, I could see it indexing the Archytax subfolder and others that were not included, but now after  over 30 minutes, all I have is a spinning circle and no items.  I had gone back to other folders that I had made galleries of just before and they pull up all the images, as before, but this has stopped my progress in this project dead in my tracks.
         I can't make any sense of this at all.

    Well now it's not working at all.  I moved the folder to a higher level of my directory tree, with the same result.  then I just tried a subfolder and it quickly found that there were no images, either that didn't have zzz or that ended in .tif.
    Than I tried another family folder and it quickly found no images according to the criteria.  So now the search function just doesn't work.

  • Mov file in Keynote doesn't work in 4.0

    I've been a presenting a Keynote file that includes many imbedded animations (mov or mpeg files) I did not create. I just upgraded to Keynote 4, and now one of the slides has stopped working. This shows Lake Chad slowly drying up (from Gore's presentation in An Inconvenient Truth), and previously it dissolved slowly from the Lake in 1963 through intermediate steps until it is gone in 2001. Now it freezes in 1963 and the jumps to 2001.
    When I view package contents on the file, and double click on the mov file (there are actually a couple that I see), the movie runs fine in Quicktime. Anybody have any ideas for me? I'm making a major presentation using this file on Thursday. I guess I can save as an earlier version and reinstall Keynote 3...
    Thanks.
    Andy

    I just open my next weeks lecture form last year and the movie doesn't play... The movie is a 281 MB H.264 movie... I can open it in quicktime and it works fine, plays in keynote 3 just fine. If I put the movie in a new presentation file it doesn't work... The preview thumbnail slide along the edge shows the movie, but it's just a blank white pane in the slide.
    I just searched my HD and popped in a whole bunch of .mov movie files and they all play just fine, until I put in another H.264 one, it is also just a blank white window...
    I can't believe apple didn't test H.264 in keynote 4 so this must be a setting somewhere, right?
    please don't make give his lecture in powerpoint!

  • Finding XML file from EJB doesn t work.

    Hi all:
    I have an EJB accesing a XML file to parse a XML document. The file is in the classpath, and sometimes the EJB finds it and sometimes not.
    What happens?
    When the EJB finds it, DOMParser method, parse(InputStream), doesn t work.
    I use this file to config DB connection externally for my BC4J (I don t use JTS).
    Thanks in advance.
    Joaqumn.

    Well, it won't work as iWeb has no import facility so cannot open html files.
    What you could do is upload the html file to wherever you are hosting your site and create a link to it from iWeb, or find another package similar to the one you are using at present that is for Mac rather then PC.

  • Downloading files using HttpConnection is very slow

    Hi
    I've written a program which will download files over HTTP protocol using the class HttpConnection. I am connecting to the net using Proxy with authorization. At times it takes long time to download even a 2 MB file, but it works very fast on fewer occasions. The same file If I try to download using browser such as IE or FireFox, download happens in few seconds.
    I am not sure where the problem is. Can anyone guide me on this issue?
    Regards,
    Faisal

    The HTTPUrlConnection do not seem to utilize the
    Connection Keep Alive feature of HTTP so it createa
    seperate connection for each request.Eh? The Sun implementation can utilize HTTP
    Connection Keep Alive if you tell it to, and it also
    runs a connection pool.Great! can you explain a bit how you enable it?
    Can I just do it by setting the Connection: Keep-Alive header

Maybe you are looking for