Possible to download file using ajax on demand process?

In the past I've used procedures with the wpg_docload.download_file function to download files by granting public to the procedure and executing the download from a report link (such as http://localhost:8080/apex/schema_name.download_blob?file_in=xxx)
I'd like to move to the download to a link that's called from an ajax called on demand process. Is this possible? I have got the report link calling a javascript function passing the rowid in and running the same download_blob procedure via the on demand process but, whilst the code runs OK it does not return the prompt box for the user to open/save the file. I guess this might be because it's not returning it to the javascript in the proper way but I'm v flaky wrt to ajax.
var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=download_blob' , 0);
var ajaxResult = ajaxRequest.get();
Thanks
Simon

To be honest, it's not a big deal, I wanted to do it this way as we have data stored as BFILES and some of the downloads are so big they take a while to load into a temp_blob and thus I wanted to call it from java script so I could call a loading "div" 1st, so the user does not see the screen hanging. However I've changed the code to load the BFILE into an actual blob 1st (through an ajax process) and then return a link to the screen pointing to an app process which opens the blob.

Similar Messages

  • 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

  • Hi, is it possible to download apps using itunes because we dont have wifi connection, we only have internet service connected to PC. thanks

    hi, is it possible to download apps using itunes because we dont have wifi connection, we only have an internet service connected to the PC.

    There are some steps on this page for syncing a device (the page talks about iPhones, but it would work for iPads as well) to a new computer : Syncing to a "New" Computer or replacing a "crashed" Hard Drive.
    When you connect an iPad to a computer's iTunes for the first time it might give you two options, to replace what is currently on the iPad with what is in that computer's iTunes library, or to set it up as a new device (i.e. remove all content from it) - hopefully the above page will get around that.
    You should be able to use different computers to update the iOS version and to sync content (can you not use the same computer ?), but you will probably have to do the above for both.
    If you don't currently have anything on the iPad that you don't mind losing (have you downloaded apps or other content when you've had access to wifi e.g. in shops, other people's homes ; or got any documents etc on it) then you don't need to go through the steps on that page.

  • 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.

  • After downloading InCopy I click on the downloaded file to install, but the process stops when trying to connect with server and doesn't carry on.

    After downloading InCopy I click on the downloaded file to install, but the process stops when trying to connect with server and doesn't carry on. Can you please help?
    Thanks,

    Agathe.texier which copy of InCopy are you downloading and installing?  Do you receive any specific error messages?  Finally what operating system are you using?

  • Is it possible to download files individually ,instead of all together, while selecting multiple files to download.

    i want to download multiple files , but some of the files are very large and i don't want to sit at my computer all day waiting to unpause or pause downloads so that the files will download faster . i was wondering if there was a option to download files individually instead of all together. when they download together it can sometimes cause problems because my internet will restart and go to a slower data speed at different times of day. this causes files to be incomplete sometimes and sometimes have to be started over completely. so is it possible to have a downloading list that manages itself and puts downloads on hold until a previous file downloads?

    You are probably limited by the speed of your download line. Consider possibly doing this overnight. The speed may be faster off peak and you will be able to leave the computer unattended.
    Any possibility of getting compressed versions of the files to download ? Alternatively consider looking for specialised download management software. You could even probably use your Operating System and schedule the tasks with that.

  • How can i upload file using ajax post request and jsp

    Hi
    this is my code files
    addPhoto.jsp
    <html>
    <head>
    <title>Add Photo</title>
    <script>
    var optionNo = 0;
    var i=1;
    var val=0;
    var file = 0;
    var exten = new Array(".jpg",".jpeg",".gif");
    function addValues()
         for(var i=0;i<5;i++)
              optionNo += 1;
              oNewOption = new Option();
              oNewOption.text = optionNo;
              oNewOption.value = optionNo;
              addSelect.add(oNewOption);
    function addBoxes()
         var str = "";
         var j=0;
         val = document.getElementById('addSelect').value;
         for(j=1; j<= val; j++)
              str = str + '<font size=3>file:' + j + '</font>';
              str = str + '<input type="file" id=filepath'+ j +' name=file'+ j + ' onchange="uploadFile(hidden'+ j + '.value)"><div id="result'+ j +'"></div>
              str = str + '<input type="hidden" name="hidden' + j + '" value=' + j +'>';
         document.getElementById('addPhoto').innerHTML = str;
    function uploadFile(value)
    var str = "filepath" + value;
    file = value;
    var param = document.getElementById(str).value;
    var parameter = "filepath=" + param;
    alert(parameter.length);
    if(checkValidity(param))
    var url = "uploadFile.jsp";
    if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    req.open("POST", url, true);
    req.setRequestHeader("Content-type", "multipart/form-data");
    //req.setRequestHeader("Content-length", parameter.length);
    req.setRequestHeader("Connection", "close");
    req.onreadystatechange = callback;
    req.send(null);
         else
              document.getElementById("result" + file).innerHTML = "upload .jpeg,.jpg,.gif Files Only";
    function callback() {
    if (req.readyState == 4) {
    updatepage(req.responseText);
    function updatepage(str){
         document.getElementById("result" + file).innerHTML = str;
    function checkValidity(str)
         var i=0;
         var j=0;
         var str1 = str.substring(str.lastIndexOf("."),str.length);
         alert(str1);
         for(i=0;i<exten.length;i++)
         if(str1.search(exten) != -1)
              j++;
              break;
         if(j>0)
              return true;
         else
              return false;
    </script>
    </head>
    <body onload="addValues()">
    <h5>Add Photo(s)</h5>
    <select id="addSelect" name="addSelect" onchange="addBoxes()">
    <option id="select" selected>Select</option>
    </select>
    <div id="addPhoto"></div>
    </body>
    </html>
    uploadFile.jsp
    <%@page import="java.io.*"%>
    <%
    /*try
    String contentType = request.getContentType();
         System.out.println(request.getMethod());
         System.out.println("Content type is :: " +contentType); 
         if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
              DataInputStream in = new DataInputStream(request.getInputStream());
              DataInputStream in1 = in;
              int formDataLength = request.getContentLength();
    System.out.println(formDataLength);
              byte dataBytes[] = new byte[formDataLength];
              int byteRead = 0;
              int totalBytesRead = 0;
              while (totalBytesRead < formDataLength)
                   byteRead = in1.read(dataBytes, totalBytesRead, formDataLength);
                   totalBytesRead += byteRead;
              out.println("<br>totalBytesRead : " + totalBytesRead + " : formDataLength = " + formDataLength);
         } catch(Exception e) {
              e.printStackTrace();
         try
         String filePath = request.getParameter("filepath");
         System.out.println(filePath);
         File f= new File(filePath);
         String path = f.getName();
         String contentType = request.getContentType();
         System.out.println(contentType);
         //InputStream in = new FileInputStream(filePath);
         DataInputStream in = new DataInputStream(request.getInputStream());
         int formDataLength = request.getContentLength();
         System.out.println(formDataLength);
    byte[] buf = new byte[1024];
    OutputStream out1 = new FileOutputStream("c:/docs/" + path);
    int len;
    while ((len = in.read(buf)) > 0) {
    out1.write(buf, 0, len);
    in.close();
    out1.close();
         out.write("File Uploaded SucssesFully");
    catch(Exception e)
         e.printStackTrace();
         out.write("error while Writing File");
    %>
    the above code in request.getContentType() i am getting 0. I am not passing the content length. for the same application with out using Ajax i am
    getting the size of file... it is very very urgent for me.. pls help me out on this...
    Any one having the code on this pls mail me the code...
    my mail id ... [email protected]
    Regards
    Ashok Kumar

    Sure, you can upload a file, using a form input element of type file. You pick this up with a servlet, though you need a special request wrapper to sort out the multi-part request you get back that way (there's a suitable package on jakarta.apache.org/commons)
    The servlet decrypts the file and can pass the results to a JSP for display.
    Don't try to do the complicated stuff in a JSP, it all gets incredibly messy, and that's not what JSPs are for.

  • How to download file using ftp in bash script

    Hi! I'm runnig a bash script in solaris i want within the script to dowload file using ftp
    How can i do it?
    Tanks a lot

    hello,evgchech
    please try this way:
    1. In the bash script, try following command:
    ftp -n < ftpcmdfile2 in the ftpcmdfile (which is a file),coding the interactive commands of FTP such as:
    user anonymous  [email protected]
              cd /var/sun/download
              bi
              mget *.*
              bye
         try it and good luck!
    Wang Yu
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • 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 );

  • 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

  • [N80] Is it possible to share files using WLAN 802...

    Hello.
    I dont have a Bluetooth connection but I would like to share files between my computer and my N80 using the WLAN not bluetooth.
    Thanks

    maybe if we could get a Symbian emulator for windows , we could setup the WLAN connection and then share files from Symbian to Symbian.
    but when you share files using bluetooth you are also making a connection Windows->Symbian.
    therefore is kinda weird.Message Edited by macnet on 11-Aug-200705:18 PM
    Message Edited by macnet on 11-Aug-200705:18 PM

  • Computer slows down while downloading files using Safari version 4.0.3

    I experience some performance issues while downloading files from the internet.
    The system performance/responsiveness is perfect until starting the download process.
    E.g. opening the finder takes noticeably more time.
    However, the worst is moving the mouse (bluetooth mighty mouse). It's hard to explain, but during a download there's a lag which could be compared to decreasing the mouse sensitivity to a minimum.
    Maybe someone could help me with that...
    Thanks a lot!

    HI and Welcome to Apple Discussions...
    Check to see how much free drive space there is on the MacBook.
    Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. *Make sure you always have a minimum of 10% to 15% free disk space at all times.*
    If you need to free up disk space, go here for help.
    http://www.thexlab.com/faqs/freeingspace.html
    Could be an underlying issue with the hard disk. Boot from your install disk and run Disk Utility.
    Insert Installer disk and Restart, holding down the "C" key until grey Apple appears.
    Go to Installer menu and launch Disk Utility.
    Select your HDD (manufacturer ID) in the left panel.
    Select First Aid in the Main panel.
    *(Check S.M.A.R.T Status of HDD at the bottom of right panel. It should say: Verified)*
    Click Repair Disk on the bottom right.
    If DU reports disk does not need repairs quit DU and restart.
    If DU reports errors Repair again and again until DU reports disk is repaired.
    When you are finished with DU, from the Menu Bar, select Utilities/Startup Manager.
    Select your start up disk and click Restart
    Carolyn

  • How to remove a downloaded file using Vuze!!

    Hello,
    I recently purchased the latest MBA 13" just 2 days back, coming from a windows background, this is my first MBA experience.
    I downloaded and installed VUZE bit torrent for Mac and downloaded a movie but am not getting where the movie is stored,  I got into the vuze application and saw the default folder where it stores the downloads: /Users/arun/Library/Application Support/Vuze/Documents/Downloads/File.mp4.
    I have tried to delete the file but am unable to do so, can someone please help on how to navigate to folders and sub folders in MAC, on any windows PC the above mentioned path could be seen, but am unable to spot the "library" folder under "arun" but the above mentioned path does mention about that.
    Please let me know if anyone needs more details than I have provided.Looking for a quick resolution.
    Thanks,
    Arun

    Go to spotlight at top, the magnifying glass icon in the menu,  type in File.mp4   your file you downloaded.

  • AJAX & On Demand Process Error

    Hi All,
    I have a SQL report that display a group of employees with a check box column,when a button pressed i need to
    copy a value of an item to the text box corresponding to the selected employees without refreshing the page.to do this, i used AJAX and On Demand Process and it was the firist time to deal with on demand processes. . But when I clicked the button nothing happened and no java script error is raised.
    the report SQL query:
    select apex_item.checkbox(2,ID,'UNCHECKED') " ",ID, NAME, APEX_ITEM.TEXT(3,ID) "Value"
    from Emp
    where FK_USER_ID=(SELECT "FK_Emp_ID"
    FROM "Users"
    where "User_Name"=V('APP_user'))
    order by 1
    the java script function invoked by the button:
    var arr=new Array();
    var ajaxRequest=new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=copy_process',0);
    arr=document.getElementsByName('f02');
    *for(i=0;i<arr.length;i++){*
    *ajaxRequest.addParam('f12',arr.value);*
    var ajaxResult=ajaxRequest.get();
    ajaxRequest=null;
    and the Process:
    FOR i in 1..APEX_APPLICATION.G_F12.COUNT LOOP
    FOR j in 1..APEX_APPLICATION.G_F03.COUNT LOOP
    if(APEX_APPLICATION.G_F03(j)=APEX_APPLICATION.G_F12(i)) then
    APEX_APPLICATION.G_F03(i):=:VALUE;
    end if;
    end loop;
    end Loop;
    Can any one help me??

    Hi,
    When you post code wrap it to {noformat}
    {noformat} tags so it is easier to read.
    I'm 100% sure you get some JavaScript error. How you have check that there was no errors ?
    Take Firefox and Firebug extension. Run page and check Firebug console.
    Also you do not pass f03 to On Demand process so below part of process do not never loop
    FOR j in 1..APEX_APPLICATION.G_F03.COUNT LOOP
    if(APEX_APPLICATION.G_F03(j)=APEX_APPLICATION.G_F12(i)) then
    APEX_APPLICATION.G_F03(i):=:VALUE;
    end if;
    end loop;Also your report select look strange. Is your table and column names really case sensitive ?
    And do not use v function in report query. Use bind variables like :APP_USERRegards,
    Jari

  • Is there a possibility to download files directly to the external usb drive in Firefox for Android?

    I have the Android device that support external usb hard drive, when I want to download some files via Firefox there are only two possible "places" where I can put the files - external memory or SD card. It will be nice if there would be an option to save file on ext. usb drive.

    Hi Nix_N1:
    Yeah I don't know about this and I don't have an Android device that supports USB storage.
    What Android device are you using and what operating system (Jellybean? Ice Cream sandwich ?)
    I asked the Mozilla QA folks and they said Firefox for Android uses the Android platform download directory so the USB drive *should* show up if it registers properly with Android.
    They suggested the following:
    # removing the SD card and seeing if it shows up in place of the SD card.
    # perhaps changing the following preference (type "about:config" in the url bar without the quotation marks)
    ''' browser.download.dir'''
    will fix it ('''WARNING:untested and unsupported but hopefully this might help''')
    Regardless I suggest filing a bug at (I looked but couldn't find a bug that corresponds to this):
    https://bugzilla.mozilla.org/enter_bug.cgi

Maybe you are looking for