Download file stored in Database?

We are implementing a mini DMS in our application and need to
write and read files to the database. We are trying to figure out
if we can convert the byte array we get from the DB into a file
that the end user can save on the client machine.
Is this possible with Flex? I have heard no, but that Apollo
might allow it. What is Apollo?
Any ideas on how we could accomplish this with Flex3?

Apollo is what Adobe AIR was call in it's last version.
It's certainly possible to donwload this file from DB to
user's machine using Flex. And the bulk of the job would be done on
the server side, using Java/.NEt/PHP/whatever.
Flex would simply send a request using FileReference class to
a server side page and that page would read the file from DB as
byte array and write to the response. That would allow user to save
the file on his/her machine.
ATTA

Similar Messages

  • Access forms File stored in database

    Can any body help in this
    Call_Form('i:\test\fmb\entgrp');
    here entgrp is the FMX file stored in Server which is mapped to i:
    1 Now if i want to use this call_form
    to call the file stored in database what is the syntax
    2 and How to invoke this file from desktop using f45run
    3 The File Stored in Databse like this is fmb or fmx
    Thanks in Advance

    When you save a Form to the database it is the FMB that you save and not the FMX. So you'll need to have the FMX on a file system and call it from there.
    f45run recieves parameters such as userid=scott/tiger module=a.fmx
    Check out the help to see the full list.
    (P.S. Isn't it time you upgraded to a newer version of Forms?)

  • Downloading file from a database..

    Iam writing an application which downloads a file from the database.The file lists will be displayed for the user. When he clicks a particular file, he gets a window with open, save cancel options
    (i am using response.setHeader("Content-disposition","attachment; filename="+selectedfile);
         response.setContentType("application/octet-stream");)
    I am reading the file from the database and storing it in the client system and then reading it from the saved location to view the downloaded file. But when it is viewed, the file is being copied to the temporary internet files folder and from there it is shown. So the file is in the two locations at the client side...
    When user downloads it i am storing it in "c:/downloade/" directory and again reading from the c:/downloaded/" to display the file. But when I see the path of the file opened through its properties its showing the temporary internet file folder location..
    "C:\Documents and Settings\.....\Temporary Internet Files\Content.IE5\2RED0V4P\v[1].jpg".
    Please tell me is my procedure is correct, can we view it without downloading it to the client system. I am giving the code in my program..
    FileOutputStream fs=null;
                   FileInputStream fis=null;
                   Connection con=DBUtil.getConnection();
                   Statement st=con.createStatement();
                   response.setHeader("Content-disposition","attachment; filename="+selectedfile);
                   response.setContentType("application/octet-stream");
                   try
                        ResultSet rs=st.executeQuery("select DOCUMENT from md_documents where DOCNAME='"+selectedfile+"'");
                        fs=new FileOutputStream("C:/Documents and Settings/admin/Desktop/download/"+selectedfile);
                                            int n=0;
                        InputStream is=null;
                        while(rs.next())
                             is=rs.getBinaryStream(1);
                             int i=is.read();
                             while(i!=-1)
                                  fs.write(i);
                                  i=is.read();
                   }catch(Exception e){System.out.println("Cause-->"+e);b=false;}
                   BufferedInputStream bis = null;
                   BufferedOutputStream bos = null;
                   String fname="C:/Documents and Settings/admin/Desktop/download"+selectedfile;
                   try{
                        fis=new FileInputStream(new File("C:/Documents and Settings/admin/Desktop/download/"+selectedfile));
                   int length = fis.available();
                   bis = new BufferedInputStream(fis);
                   bos = new BufferedOutputStream(out);
                   byte[] buff = new byte[length];
                   int bytesRead;
                   while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                   bos.write(buff, 0, bytesRead);
                   }catch(Exception e){System.out.println("in reading "+ e);}
                   out.flush();
                   out.close();
                   con.close();
    Please suggest me the solution..even if we have to download it to the local system..how to give the path..plz help me.

    You can do this task using the packages provided to work in PSP pages. If you want I can guide step by step to this if you choose to do it with PSP pages.
    Joel Pérez

  • How to display the content from a file  stored in database

    when i am trying to display the content from a file which stored in database on oracle report 10g
    data are displaying as following. please help me to display the data in readable format
    <HTML LANG="en-US" DIR="LTR">
    <!-- Generated: 1/11/2006, postxslt.pl [1012] v1
    Source: amsug304286.xml
    File: amsug304286.htm
    Context: nil
    Tiers: ALWAYS
    Pretrans: YES
    Label: Release 12 -->
    <HEAD>
    <!-- $Header: amsug304286.htm 120.4 2006/11/01 20:57:29 appldev noship $ -->
    <!--BOLOC ug1_OMPO1010302_TTL--><TITLE>Product Overview (ORACLE MARKETING)</TITLE><!--EOLOC ug1_OMPO1010302_TTL-->
    <LINK REL="stylesheet" HREF="../fnd/iHelp.css">
    </HEAD>
    <BODY BGCOLOR="#F8F8F8">
    <A NAME="T304286"></A><A NAME="ProdOve"></A>
    <CENTER><H2><!--BOLOC ug1_OMPO1010302--><B>Product Overview</B><!--EOLOC ug1_OMPO1010302--></H2></CENTER>
    <p><!--BOLOC ug1_OMPO1010304-->Oracle Marketing drives profit, not just responses, by intelligently marketing to the total customer/prospect base. By leveraging a single repository of customer information, you can better target and personalize your campaigns, and refine them in real time with powerful analytical tools.<!--EOLOC ug1_OMPO1010304--></p>
    <p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
    <ul>
    <li>
    <p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
    </li>
    <li>
    ls.<!--EOLOC ug1_OMPO1010304--></p>
    <p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
    <ul>
    <li>
    <p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
    </li>
    <li>
    <p><!--BOLOC ug1_OMPO1006613--><B>Sales Alignment</B> - Oracle Marketing's leads management helps you compile and distribute viable leads so that sales professionals can follow up valuable opportunities and not just contact interactions. Additionally, support for distributing proposals and marketing material drive speedy and consistent setups and collaboration of best practices.<!--EOLOC ug1_OMPO1006613--></p>
    </li>
    <li>
    <p><!--BOLOC ug1_OMPO1006614--><B>Marketing Insight</B> - While Oracle Marketing Home page reports and Daily Business Intelligence (DBI) for Marketing and Sales provide aggregated management level information in almost real time, operational metrics help in tracking the effectiveness of individual marketing activities.<!--EOLOC ug1_OMPO1006614--></p>
    </li></ul>
    </BODY>
    </HTML>
    <!-- Q6z5Ntkiuhw&JhsLdhtX.cg&Zp4q0b3A9f.&RQwJ4twK3pA (signum appsdocopis 1162406236 2673 Wed Nov 1 10:37:16 2006) -->

    Hi,
    you can try to use the:
    <b>ConsumerTreeListPreview</b>
    layout for KM navigation ivew (or customize to your own).
    This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
    Hope this helps,
    Romano

  • Downloading files FROM a database

    I'm stuck with a problem
    I used a
    <input type=file .../> tag to add my file into the database
    first i converted it into a byte[]
    and now it seems good stocked in my SQL Server database...
    The point is how to get it on my harddisk now ??
    how can i do to get a SaveAs Dialog box to save it on my disk??
    have i to use swing or awt ?? (hope not)
    THANXX TO HELP

    hi dear
    to down load on client mashine you need to play trick just confuse server about mime type is pass anything in mimie type and read that file it will automatically open download dialog box. i think u get releif
    <%
    response.setContentType("attachment/force-download");
    String fname1=request.getParameter("filename");
    String afname1=request.getParameter("actualfname1");
    response.setHeader("Content-Disposition","attachment;filename="+afname1);
    //response.sendRedirect("UploadedFiles\\"+fname1);
    try {
    //java.io.FileInputStream fin=new java.io.FileInputStream("C:\\Apache Tomcat 4.0\\webapps\\Procurement\\UploadedFiles\\"+afname1);
    java.io.FileInputStream fin=new java.io.FileInputStream("C:\\Apache Tomcat 4.0\\webapps\\Procurement\\UploadedFiles\\"+fname1);
    int i;
    while((i=fin.read())!=-1)
    {out.print((char)i);
    //System.out.println((char)i);
    }fin.close();
    }catch(Exception e)
    //System.out.println("@@@ ---------------- n @ @@@@ @@@ @@@ Inside download filev iewmof File ATACH +++ "+e);
    %>

  • View file stored in Database in client machine

    Hi,
    I am using oralce forms Release 10.2.0.1.0 .
    In my application , files (.xls,.pdf,doc,gif etc) will be stored in Database table as BLOB. I have to add the provison to view the file in client browser.
    I tried using the webutil function to transfer file from DB to client and then from client to AS and showed the file using web.show_document. The issue with that solution is file keeps on created in AS server. is there a way i can programatically delete the file from AS, after showing using web.show-document.
    Or can anyone suggest any other solution for the same.
    Thanks in advance.

    Hello,
    There is no need to transfer the file on the AS if they are stored in the database.
    <p>Read this article.</p>
    Francois

  • Manupulating Excel File Stored In Database

    Is there any way I can manipulate the excel file that is stored in the database as LONG RAW ?
    I need to allow user to manupulate the excel file that is stored in database and accordingly fetch the specific data from that manipulated Excel File of Database.

    Your best bet is to keep the data in tables and generate a new excel file each time. Search this forum on how to generate excel files.. Here are three techniques... I like the XML method..
    1) OLE2
    2) XML
    3) CSV
    I have also done this using webutil..
    1) retrieve excel blob from db to client using webutil function db_to_client_with_progress()
    2) manipulate excel file on client using CLIENT_OLE2
    3) put excel file back in db using webutil function client_to_db_with_progress()
    Sorry.. Just re-read your post and didnt notice the Long-raw part.. :)
    Message was edited by:
    Mark Reichman

  • Sound file storing in Database &  accessing these files

    Hi Friends
    i have working on the project of Sound Recognization system
    the requirement is that sound should be passed through mike input device & that sound should be stored in to database along with the user & password
    for recognization & identification of user
    But problem in storing the sound files in the database so how can i store the files into the database so please guide me.

    brad103 wrote:
    In my particular application, I process the byte array from the TargetDataLine. Then I save this to a db using new ByteArrayInputStream(soundData), soundData.length); where soundData is my byte[].
    Am I correct that this will save the data in the relevant format (eg PCM_SIGNED, 8k, 16bit, etc), but the header information is not included? That's correct. Essentially, in JavaSound, that data has an associated "Format" object that was part of the line the data came from, would need to be given to any line the data was going to...and that format object is essentially a container for all of the header data...
    And if so, then if I control the saving and retrieval then I can omit that step anyway as I know the format?You can omit the AudioSystem.write step and store the byte[] directly into the database...as long as you're capable of, as above, recreating the Format object that was originally associated with the data.
    And my next question (digressing slightly, sorry umeshS), is that when using the tritonus gsm library and converting from above format to gsm, should I be using AudioSystem.write to write to an outputstream prior to calling AudioSystem.getAudioInputStream(targetEncoding, originalAIS) to convert encodings?AudioSystem.write adds the file header to the stream, and that's all. If you're using a "stream", you have to have the Format object in order to create an AudioInputStream, so there's no need to add the file header (and the file header will screw things up if you're not using the File or URL versions of getAudioInputStream)...
    So, as a giant summary...
    AudioSystem.write adds a file header, which will include format information. This should only be used if you're planning on using AudioSystem.getAudioInputStream(File f) to read the file the next time.
    Otherwise, just save the data and the Format object associated with the data, so you can read it all back in later by building an AudioInputStream around your favorite IO stream.
    And in retrospect, after explaining all of that...umeshS, the problem with the way you're doing it is that when you copy the file into the database, you're copying the file header. And then, because you're not using the "File" version of AudioSystem.getAudioInputStream, the system isn't handling the file header being there correctly.
    You need to copy things into the database by creating an audioinputstream of your file, and then saving out the raw byte[] data. You can just call "read" on the ais a bunch of times and throw the results into your stream. Then, you can play it by pulling the data out of the database via a stream, and playing that stream by throwing it back into an AudioInputStream.

  • Where are download file stored before I select a save location? It looks like it starts the download before I choose a location.

    I noticed that downloads start before I select a save location. Where are these files stored?

    Firefox starts a download immediately in the background to the OS %temp% folder.

  • Upload and Download file using MySQL database.

    Can anyone help me ....
    how to write a code to upload file to and retrieve file from MySQL database.
    The files may be .bmp , .wav, .zip, .exe and so on....
    thank you...

    Cross-posted and multi-posted.

  • Download files form oracle database in WD?

    Hello all,
    I have a scenario like:
    I have stored the flat files in the Oracled table with the BLOB concept.
    How to download the blob objects in web dynpro?
    PLease help regarding this.
    Regards,
    CSP

    hi
    good
    check this code
    Ask your system Admin for servername,portnumber of database server
    Connection conn=null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn =DriverManager.getConnection ("jdbc:oracle:thin:@<servername>:<portnumber>:DB","uname", "pwd");
    Statement stmt=conn.createStatement();
    ResultSet rs=stmt.executeQuery("select * from <tablename>"); // select statment
    while(rs.next())
    IXXElement nodeConnection=wdContext.createXXElement(); //creating a node to store the data from oracle
    nodeConnection.setYY(rs.getInt("YY")); // setting the values into input fields
    nodeConnection.setAA(rs.getInt("AA"));
    nodeConnection.setBB(rs.getInt("BB"));
    wdContext.nodeXX().addElement(nodeConnection); // adding the node
    catch(Exception ex)
    finally
    try
    conn.close(); // closing the connection
    catch(Exception e)
    check this link too
    https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=47055
    thanks
    mrutyun^

  • Size limit of access database with image files stored outside database

    I have read 2GB limit on size of Access database.  We are using Access 2013 database with fields that are data type attachment and storing attached images outside the database.  Does the size of the folder that is holding these images count
    in any way toward 2GB size limit?

    Hi,
    As far as I know, Access database limit size 2GB based on itself, not related to the folder size.  Attachment data
    type is similar to attaching files to e-mail messages. We need to control the Access database size is smaller then 2GB.
    When a field is defined with the attachment data type, you can store one or more files for each record in it.
    Attachments can dramatically increase the size of the database, but since the attached file is stored as a part of the dabatbase, you are not dependent on network drives being available as you would be if you inculded a hyperlink to the file. As a matter of
    fact, feel free to backup the origainal file to other disk after you attach it to the database.
    Regards,
    George Zhao
    TechNet Community Support

  • Open word file, stored in database through Forms.

    Assalam-o-Alikum
    to Genius of Oracle's
    I have stored the Word file name "MY_FILE.DOC" in oracle database. Now i want to open the file through Forms, remember i am using forms 6i. is there any body who help me to open the file.
    Best Regards
    Farrukh Shaikh

    Assalam-o-Alikum
    My in tension was not to hurt any body. if it did then sorry for that.
    here is the code through which i stored the file in database
    first create the DIRECTORY CREATE DIRECTORY generic AS 'C:\temp';---- --directory path where your files will be searched for storing.
    THEN
    create table my_blob_table
    pk_name varchar2(20) primary key,
    pk_value varchar2(20),
    col_document blob
    INSERT INTO MY_BLOB_TABLE
    (PK_NAME,PK_VALUE)
    ('A','A');
    COMMIT;
    CREATE OR REPLACE PROCEDURE load_blob_from_file
    ( src_file_name IN VARCHAR2
    , table_name IN VARCHAR2
    , column_name IN VARCHAR2
    , primary_key_name IN VARCHAR2
    , primary_key_value IN VARCHAR2 ) IS
    -- Define local variables for DBMS_LOB.LOADBLOBFROMFILE procedure.
    des_blob BLOB;
    src_blob BFILE := BFILENAME('GENERIC',src_file_name);
    des_offset NUMBER := 1;
    src_offset NUMBER := 1;
    -- Define a pre-reading size.
    src_blob_size NUMBER;
    -- Define local variable for Native Dynamic SQL.
    stmt VARCHAR2(2000);
    BEGIN
    -- Opening source file is a mandatory operation.
    IF dbms_lob.fileexists(src_blob) = 1 AND NOT dbms_lob.isopen(src_blob) = 1 THEN
    src_blob_size := dbms_lob.getlength(src_blob);
    dbms_lob.open(src_blob,DBMS_LOB.LOB_READONLY);
    278 Oracle Database 11g PL/SQL Programming
    END IF;
    -- Assign dynamic string to statement.
    stmt := 'UPDATE '||table_name||' '
    || 'SET '||column_name||' = empty_blob() '
    || 'WHERE '||primary_key_name||' = '||''''||primary_key_value||''' '
    || 'RETURNING '||column_name||' INTO :locator';
    -- Run dynamic statement.
    EXECUTE IMMEDIATE stmt USING OUT des_blob;
    -- Read and write file to BLOB.
    dbms_lob.loadblobfromfile( dest_lob => des_blob
    , src_bfile => src_blob
    , amount => dbms_lob.getlength(src_blob)
    , dest_offset => des_offset
    , src_offset => src_offset );
    -- Close open source file.
    dbms_lob.close(src_blob);
    -- Commit write.
    IF src_blob_size = dbms_lob.getlength(des_blob) THEN
    $IF $$DEBUG = 1 $THEN
    dbms_output.put_line('Success!');
    $END
    COMMIT;
    ELSE
    $IF $$DEBUG = 1 $THEN
    dbms_output.put_line('Failure.');
    $END
    RAISE dbms_lob.operation_failed;
    END IF;
    END load_blob_from_file;
    after create the PROCEDURE run the procedure
    begin
    load_blob_from_file('FILE_NAME.DOC',' my_blob_table','col_document','PK_NAME','A');
    end;

  • How to play .swf files stored in database?

    Ok, i am pretty stuck with this...
    Here is the problem:
    I have upload form which upload file to the server folder and in the database insert path. That works fine. What is my problem? When i go to dreamweaver and make insert SWF and i give the path to that file in database, on my web page always stays:
    Content on this page requires a newer version of Adobe Flash Player.
    But i have installed that flash player... And when i change the path to file that is actualy stored in folder on the server, all plays nicely?
    Is this the way to solve this problem? I want to display dinamicaly .swf files into my web page. Please help. Thank you.

    Ok, i dont understand what you mean,
    sorry for my bad english... This is the link to the web page : http://casmedia.blog-media.net/admin/111.php
    And this is the structure of my site in dreamweaver, as you can c i have folder and file in it...
    And this is the page:

  • Use WEBUTIL for upload and download file to/from Database

    Dear friends
    I have a table with three columns (id , name , myDoc) myDoc is a BLOB, I would like upload word documents or PDFs or images to myDoc column, I use Oracle Form 10g, I try to use webutil to solve my problem, but I couldn't, Please help me.
    Thanks

    # Details
    # transfer.database.enabled : Can be TRUE or FALSE - allows you to disable
    # upload and download from the database server.
    # transfer.appsrv.enabled : Can be TRUE or FALSE - allows you to disable
    # upload and download from the application
    # server.
    # transfer.appsrv.workAreaRoot: The root of the location in which WebUtil can
    # store temporary files uploaded from the client.
    # If no location is specified, Application Server
    # user_home/temp will be assumed.
    # This location is always readable and writable
    # no matter what the settings in
    # transfer.appsrv.* are. This setting is
    # required if you need the Client side
    # READ/WRITE_IMAGE_FILE procedures.
    # transfer.appsrv.accessControl:Can be TRUE or FALSE - allows you to indicate
    # that uploads and downloads can only occur from
    # the directories named in the
    # transfer.appsrv.read.n and
    # transfer.appsrv.write.n entries and their
    # subdirectories. If this setting is FALSE,
    # transfers can happen anywhere.
    # transfer.appsrv.read.<n>: List of directory names that downloads can read
    # from.
    # transfer.appsrv.write.<n>: List of directory names that uploads can write
    # to.
    #NOTE: By default the file transfer is disabled as a security measure
    transfer.database.enabled=true
    transfer.appsrv.enabled=true
    transfer.appsrv.workAreaRoot=
    transfer.appsrv.accessControl=TRUE
    #List transfer.appsrv.read.<n> directories
    transfer.appsrv.read.1=c:\temp
    #List transfer.appsrv.write.<n> directories
    transfer.appsrv.write.1=c:\temp

Maybe you are looking for