Download file from the database server, through application server.

Nice day

I use Jdeveloper 11.1.2.3.0.

I have a requirement to download a file that already exists on the database server Directory. Now my current scenario is that user is connected to the application server, and the user has no direct access to the database server.  I drew a diagram of my requirement as:


DownloadFile.png


I get a way to do this. Please suggest.


Best regards,

Julien

The session does not expire if you are streaming data from the application to the client. However, you will need to manage the data sent over the network, because it can make the very slow network if you send this amount of data at high speeds on the network and then to the customer. This connection between client and server is the biggest problem, because bandwidth is usually small. Think about downloading software by one side oracle (for example 1 GB), this takes time and is prone to errors.

We did something similar by transferring the data from the database (in our case, it has been stored in a BLOB) on a dedicated server with a server web apache on it. Then, we send a link to the client, which then uses the link to get the special file server data.

The advantage is that you don't have to code the transfer of huge files in the application of the adf but can already use ready to use of software (balancing bandwidth and the recovery of a broken download).

Timo

Tags: Java

Similar Questions

  • How to download files from the database file system.

    Hello everyone.

    I m trying to do a procedure to download a PDF file that is stored in the file system of the server of the database and not inside the database. The established procedure is the following:


    create or replace
    PROCEDURE PRT_PR_DOWNLOAD_FICH (v_file_name VARCHAR2
    )

    AS

    V_LENGTH number;
    Lob_loc Bfile;

    BEGIN


    Lob_loc: = bfilename ('DIR_OBJ', v_file_name);
    V_LENGTH: = dbms_lob.getlength (Lob_loc);

    owa_util.mime_header ("application/octet ', False");
    HTP.p ("Content-length: ' |") v_length);
    HTP.p ('Content-Disposition: attachment; filename = "" | ") SUBSTR (v_file_name, INSTR (v_file_name, ' /') + 1) | '"');
    owa_util.http_header_close;
    wpg_docload.download_file (Lob_loc);


    END PRT_PR_DOWNLOAD_FICH;


    This procedure receive the name of the file to download and use the wpg_docload.download_file () function. The DIR_OBJ is a directory with path from the server to the folder that contains the files I want to download.

    When I run this procedure I get the error: "Internal Server Error".

    Can someone tell me what I am doing wrong and if it is the best way to download a file directly from the database server file system?

    Hello Pedro,

    Just out of curiosity, I tried your example ;-) It works very well in my environment! (Oracle 10g with OSH and Apex 3.1.2
    But: I had to grant READ permissions on my directory object to APEX_PUBLIC_USER!

    (1) I created a "test.txt" document in the directory corresponding with my EXPDIR directory object. 'Oracle' user needs read on the file & document permissions!

    (2) give APEX_PUBLIC_USER necessary READ rights on the directory object:

    grant read on the directory expdir to apex_public_user;

    (3) create the procedure:

    CREATE OR REPLACE PROCEDURE MATTHIASH. PRT_PR_DOWNLOAD_FICH (v_file_name VARCHAR2)
    AS
    V_LENGTH number;
    Lob_loc Bfile;
    BEGIN
    Lob_loc: = bfilename ('EXPDIR', v_file_name);
    V_LENGTH: = dbms_lob.getlength (Lob_loc);

    owa_util.mime_header ("application/octet ', False");
    HTP.p ("Content-length: ' |") v_length);
    HTP.p ('Content-Disposition: attachment; filename = "" | ") SUBSTR (v_file_name, INSTR (v_file_name, ' /') + 1) | '"');
    owa_util.http_header_close;
    wpg_docload.download_file (Lob_loc);

    EXCEPTION
    WHILE OTHERS THEN
    HTP.p (substr (dbms_utility.format_error_stack (): dbms_utility.format_error_backtrace (), 1, 4000));
    END PRT_PR_DOWNLOAD_FICH;
    /

    (4) Grant execute rights on APEX_PUBLIC_USER of this procedure:

    GRANT EXECUTE ON MATTHIASH. PRT_PR_DOWNLOAD_FICH TO APEX_PUBLIC_USER;

    (5) Finally, try if download document works well:

    http://: 7777, pls, apex, MATTHIASH. PRT_PR_DOWNLOAD_FICH? v_file_name = test.txt

    I would like to know if it works!

    HTH
    Matthias

  • How to download files from the file of database system

    Hello everyone.

    I m trying to do a procedure to download a PDF file that is stored in the file system of the server of the database and not inside the database. The established procedure is the following:

    create or replace
    PROCEDURE PRT_PR_DOWNLOAD_FICH (v_file_name VARCHAR2
    )

    AS

    V_LENGTH number;
    Lob_loc Bfile;

    BEGIN

    Lob_loc: = bfilename ('DIR_OBJ', v_file_name);
    V_LENGTH: = dbms_lob.getlength (Lob_loc);

    owa_util.mime_header ("application/octet ', False");
    HTP.p ("Content-length: ' |") v_length);
    HTP.p ('Content-Disposition: attachment; filename = "" | ") SUBSTR (v_file_name, INSTR (v_file_name, ' /') + 1) | '"');
    owa_util.http_header_close;
    wpg_docload.download_file (Lob_loc);

    END PRT_PR_DOWNLOAD_FICH;

    This procedure receive the name of the file to download and use the wpg_docload.download_file () function. The DIR_OBJ is a directory with path from the server to the folder that contains the files I want to download.


    I want to enable users to download PDF files stored in the file system of the database server, opening a backup / open window in the browser when the user clicks a button. When the user click on the button, the procedure is called and executed without error but save it / open window does not appear, instead the page it is simply charged, nothing happens.

    Can someone tell me what I am doing wrong and if it is the best way to download a file directly from the database server file system?

    Best regards from Pedro

    Hello

    It would help if you add

    APEX_APPLICATION.g_unrecoverable_error := TRUE;  
    

    as a final line of your procedure?

    BR, Jari

  • Recently, when I download files from the SD card, LR6 not rename the files. How can I fix it?

    Recently, when I download files from the SD card, LR6 not rename the files. How can I fix it?

    If I open the folder, not through Lr, I can rename the file. Now, the problem disappeared. Maybe it was related to the DD. I removed and put back in place the protections in SD via the menu of my camera and the problem disappeared. Now, he works as usual. Amount and rename the files by LR. Thank you for your interest

  • Logon sqlplus from the database server do not.

    I want to export data from the a database. I can sqlplus as a particular user (owner of the table) from a remote server. But when I try to sqlplus or run the exp from the database server (the server where the database is running), I refused to sign. Is there a configuration in the database in order to prevent this loggin user from the database server

    /U01/Oracle/app/product/10.2.0/DB/bin-> sqlplus testuser / *.

    SQL * more: release 10.2.0.3.0 - Production on Thu Apr 29 14:28:30 2010

    Copyright (c) 1982, 2006, Oracle. All rights reserved.

    ERROR:
    ORA-01017: name of user and password invalid. connection refused


    /U01/Oracle/app/product/10.2.0/DB/bin->. / testuser exp / * file=/tmp/interface.dmp tables = interface

    Export: Release 10.2.0.3.0 - Production on Thu Apr 29 14:28:53 2010

    Copyright (c) 1982, 2005, Oracle. All rights reserved.


    EXP-00056: ORACLE error 1017
    ORA-01017: name of user and password invalid. connection refused


    TIA
    Ravi

    Try this.
    1. the cd in your home directory.
    2. starting at the prompt, so source oraenv
    -> . oraenv
    3. When prompted enter the name of your database, in the same case, as in/etc/oratab.
    4. try to connect now
    -> sqlplus testuser / *.

    If it works for you, then you must ensure you environments ORACLE_HOME, ORACLE_SID and path are correct - as oraenv does for you.

  • Downloading files from the blob column

    Hello

    I had the file it is implemented for the database blob column using the document below:
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#85

    Now can someone please tell me how to download or view the file from the database blob column?
    I use jdev 11

    Thank you

    Hello

    At the end of your download method invoke:

    ActualExceptionIter.executeQuery ();

    Kuba

  • File extension is missing when you download files from the web

    I just got a new PC with preinstalled Windows7. From day one, I have the problem that when I download files from the internet while you have no extension, so when I try to run them, told me that they do not have an associated program. I then rename and add the missing extension and all is well. But it's very annoying to have to do every time :(

    I come home from work and now everything works fine - even my webcam which worked yesterday either. Just shows how much it means to close and start fee in time ;)

    Seems that my problem has healed itself, but thanks for the help that was offered to me.

  • Impossible to download files from the mp3 player to windows media player

    Original title: GPX ML648B MP3 Player 2 GB

    Hello

    I'm trying to download files from the mention of the above mp3 player for windows media player with Windows 7 on the laptop?

    Any suggestions or solutions.

    Thank you

    Roslyn

    Hello

    (1) if it works much earlier?

    (2) you get an error message?

    When you connect the MP3 player to the laptop, it appears in the computer as a removable disk?

    If the State, then perform the following steps.

    (a) find the files MP3, to modify, select toolbar, select ALL, then copy.

    (b) navigate to where you want music go on your hard drive, (usually the My Music folder), the toolbar, select Edit, Paste.

    (c) open Windows Media Player from the toolbar, select organize libraries, manage libraries and the music.

    You can also see the following article for more information;

    Add items to the Windows Media Player library:

    http://Windows.Microsoft.com/en-us/Windows7/add-items-to-the-Windows-Media-Player-library

  • Driver HP LaserJet P1006 downloads missing from the HP Server

    I went on the following link to navigate to the drivers for my OS (Vista 64):

    http://h10025.www1.HP.com/ewfrf/wc/product?cc=us&LC=en&DLC=en&product=3435684

    It linked me to this file:

    FTP://ftp.HP.com/pub/softlib/software12/COL21058/bi-55362-6/ljP1000_P1500-HB-PNP-Win64-en.exe

    However, this file, bi-55362-6/ljP1000_P1500-HB-pnp-win64-en.exe, is absent from the HP Server. Is the official download available anywhere else on HP site? HP can reupload this file maybe?

    Try to use FileZilla to download the file.

  • I can't download files from the internet using firefox

    If I try to download a file from the internet, it's going fine until 99%. After that, it does not...

    It is possible that anti-virus software is corrupt downloaded files or otherwise interferes with the download of files.

    Try disabling analysis in real time (live) files in your software anti-virus temporarily to see if that makes working download.

    See:

  • I was looking for where firefox downloads files from the web. Everything I can find is the download list window that has only a clear"" button.

    When I download a file from the web, I want to find it in the Windows Explorer window, but don't know where to look. (I use Windows 7 64 bit on an HP Pavillion laptop) Where is - this Firefox download files that it lists in its own small window of download, but you only allows 'Clear' the list, no copy or open, or move the file?
    Where are the actual files to?

    Map of the last file downloaded and saved

    go to the Tools Menu-> Options-> general-> downloads section-> select Radio button option 1 ' save files from "dialog box-> click the"Browse..."button "and from there you can find the exact folder hierarchy where a download was recorded recently.

    If you want to know when a download starts to download and where you want to save the download, performs the following steps:

    go to the Tools Menu-> Options-> general-> downloads section-> place checkmark on "Show the downloads window when downloading a file"-> check out of "close it when all downloads are finished"-> select Radio button Option2 'Always ask me where to save files'-> click OK.

    Check and tell if its working.

  • How to get information from the database server log?

    Oracle 9.2 UNIX
    We got an error block in the database of production last midnight for 40 minutes and nothing has been treated during this time which delayed our process by lots of night production. Then he disappeared after 40 min. I would like to know what was going on during this time in the database. My question is where can I find an error in the database server? In bdump? Appreciate any ideas.

    Thank you
    S.

    If you have jobs regularly collect statspack report, then it will be easier to troubleshoot. You can just pull the report of the time period.

    A couple of things you can check if there is a problem of storage during the time, as a backup or other work running took all storage OS, so Oracle hung because no space for archiving of newspapers. Usually it will record errors in the alert.log, but if bdump as complete destination, the error will not be recorded.
    Check the activity of the BONE during the time, which is CPU and IO activity. See if you have installed and configured sar
    Check the message of OS file.

  • When you use Internet Explorer, I can download files from the incredimail site. This does not work when I use Firefox. I see no differences in the settings. Can someone help me?

    I can download IncrediMail gold Gallery when I use internet explore content how I want, but when I use firefox sometimes it allows me to download content from the Gallery, but would not allow me to download more, or he wouldn't let me just download

    • "Clear the Cache": Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.
    • 'Delete Cookies' of sites that cause problems: Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the Add-ons is the cause of the problem (switch to the DEFAULT theme: Tools > Modules > themes).

    • Makes no changes on the start safe mode window.

    See:

  • reading a file from the ftp server

    Hello
    I am able to put the file on the ftp server using the ftp adapter. But the same settings only work not then vote file on ftp.
    Do I have to do some settings for the get operation?

    Hello

    Check the file permissions and to test give all reading/writing/execution permissions to the file to read of FTP. Also, check the file modification date.

    Check the logs at 2 places for error messages:
    -Diagnostics of SOA server logs
    -The FTP Server Logs

    You can also activate the level the END of newspapers of the adapter for the cards and see the errors in the diagnostic logs.
    FMW Console > right-click soa-infra > newspapers > Journal Configuration > expand oracle.soa > define Trace32: BEST for oracle.soa.adapter

    Kind regards
    Neeraj Sehgal

  • EOFException when downloading files from the server FTP of Bluetooth

    Hello, I am developing an application that downloads a file from a FTP of Bluetooth server. If I use this code to download a list of files works fine, but if I use the same code to download a real file it doesn't. I tried using plain text, image, video (mp4 and 3gp) and audio with the same result. If I install my app in a Nokia (N95) or a Motorola (K3) works perfectly, but I can't get it to work on my Blackberry 8310
    The problem in the BlackBerry is an EOFException when reading the first byte, no 1 is returned to indicate the end of the file, but an EOFException. BlackBerry Handheld Software (v4.2.2.173)

    This is the code to get the InputStream:

    public InputStream getFileInputStream(ClientSession conn, Operation op, String stFile, String stType) throws IOException {        InputStream inputStream = null;        byte[] FBUUID = {(byte) 0xF9, (byte) 0xEC, (byte) 0x7B, (byte) 0xC4, (byte) 0x95,                   (byte) 0x3C, (byte) 0x11, (byte) 0xD2, (byte) 0x98, (byte) 0x4E, (byte) 0x52, (byte) 0x54,                   (byte) 0x00, (byte) 0xDC, (byte) 0x9E, (byte) 0x09 };        String file = stFile;        String type = stType;        if (file==null) file="";        if (type==null) type="";        //Prepare the headers for the OBEX commands        HeaderSet header = conn.createHeaderSet();        header.setHeader(HeaderSet.TARGET, FBUUID);        //Send OBEX Connect        HeaderSet response = conn.connect(header);        //In order to go the desired folder the OBEX SETPATH command is beeing used        //Prepare the header for the SETPATH commad        header = conn.createHeaderSet();        //folder_name is set to the name of the desired folder        //if left blank the root folder will be used        String folder_name = "";        header.setHeader(HeaderSet.NAME, folder_name);        //Send the SETPATH command        HeaderSet result = conn.setPath(header, false, false);
    
            //Prepare the header for the GET command        header = conn.createHeaderSet();        header.setHeader(HeaderSet.NAME, file);        header.setHeader(HeaderSet.TYPE, type);        op = conn.get(header);        //The selected file will be send to the operation's input stream        inputStream = op.openInputStream();        return inputStream;    }
    

    And the call:

    InputStream in = getFileInputStream(conn, op, "text.txt", "text/plain");
    

    The same call that works perfectly for the list of files (in BlackBerry too):

    InputStream in = getFileInputStream(conn, op, "", "x-obex/folder-listing");
    

    This call produces an xml file which can be read perfectly by any phone.

    Any help is very appreciated!

    Concerning

    Solved. The problem is to use >-1 instead of ! =-1

Maybe you are looking for