Store file attachment in database

Dear all,
We are using Forms 4.5 and Oracle7 Server Release 7.3.4.5.0.
On the form, we want to allow user to store some file attachment such as winword documents, picture file.....any file they like, to the database.
any ways to do it?
I have tried the OLE control on the form and LONG RAW in database:
1. When attach the text file, it is display as a icon with filename, this is what I want.
2. But when attach the winword file or jpg file, it is display as the document content.
Anyway, I want the icon and filename only. Can I do that no matter what file type is?
-Jasper

Btw, you may read below links for more details
SyBooks Online
Sybase Unwired Platform ( SMP ) – Custom Attachment Icon in HWC Application
SUP HWC Attachment Viewer not displaying attachment

Similar Messages

  • Which is better? store files in the database or directly on the O.S.?

    Hi,
    i´m developing an application to manager files. which is better? store files in the database or directly on the O.S.? If i decide to store on database, i will use the BLOB data type but i have a doubt...the BLOB data type occupies the same space on database regardless of file size? there is another data type better?
    Tks,
    Fernando.

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1011065100346196442
    Ask Tom has a bit of info to share on the topic. Have a read of this. :)

  • How to store file content in database??????

    how to store file in database and retrived

    How to use Google to search for answers to questions that have been asked literally thousands of times previously??????
    How to post into the correct forum???????
    How to use less punctuation??????

  • How to store files in mysql database using JSP?

    I'm developing an online recruitment system using JSP in server side. For the users who registers in it, I want them to upload their cv's from the web site so that I can store it in the database..I'm using mysql as the db..
    Can I know how to do it.?..or else is there any better way of doing that?
    Need a quick reply..Tx

    The best way to put data in a database in a JSP is to not do it. Instead, use a Servlet that calls a DataAccessObject. The DAO puts the data in the DB and the servlet gives the data to the DAO. The JSP does nothing but display results.
    Take a google for JSP MVC and DAO. BalusC has a great example of DAO and a JSP that uses one on his blog.

  • How do you insert files into a database

    Hi
    I believe oracle can store files.
    I am trying to create a web application that will include an option of uploading files to oracle.
    What kind of data type do i create in the database, is it a file of a blob or what is it.
    Also locally how do i insert the file into the database. Would it be something like
    Insert into <tablename>(id,name,picture) values(1,Jennifer Aniston,c:\pictures\Jennifer Aniston.jpg)
    Is there any problem inserting the file using a web site url.
    Thanks
    Garry

    The easiest way to store files in the database is to use BLOB's. You can use a PreparedStatement and call the following API's:
    setBinaryStream(int parameterIndex, ...)
    setBlob(int i, Blob x)
    SCJP, SCJD, SCEA, SCWCD, SCBCD
    CISSP, PMP, PHR
    OCPDBA 8i/9i
    http://www.certgear.com

  • Store and Display doc/pdf files in the database using Forms

    Hi all,
    How can i store and display doc/pdf files in the database using Forms 10g?.
    Arif

    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    [OraHome] with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
      and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
      [JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
         cd [JacobStage]
         copy jacob.jar [OraHome]\forms\java\.
         copy jacob.dll [OraHome]\forms\webutil\.
      The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
      Open a DOS command prompt.
      Add [OraHome]\jdk\bin to the PATH:
         set PATH=[OraHome]\jdk\bin;%PATH%
      Sign the files, and check the output for success:
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
      you may skip this step. Otherwise,
      Create a schema to hold the WebUtil stored code, and privileges needed to
      connect and create a stored package. Schema name "WEBUTIL" is recommended
      for no reason other than consistency over the user base.
      Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
      out the EXIT statement, to be able to see whether the objects were created witout
      errors.
      Start SQL*Plus as SYSTEM, and issue:
         CREATE USER webutil IDENTIFIED BY [password]
         DEFAULT TABLESPACE users
         TEMPORARY TABLESPACE temp;
         GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
         CONNECT webutil/[password]@[connectstring]
         @[OraHome]\forms\create_webutil_db.sql
         -- Inspect SQL*Plus output for errors, and then
         CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
      Reconnect as SYSTEM, and issue:
         grant execute on webutil_db to public;
    5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
      to the CLASSPATH entry.
    6) Start the OC4J instance
    7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
      Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
      It is important to generate the PLX, to avoid the FRM-40039 discussed in
      Note 303682.1
      If the PLX is not generated, the Webutil.pll library would have to be attached with
      full path information to all forms wishing to use WebUtil. This is NOT recommended.
    8) Create a new FMB.
      Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
      There is no need to Subclass the WebutilConfig object.
      Attach the Webutil.pll Library, and remove the path.
      Add an ON-LOGON trigger with the code
             NULL;
      to avoid having to connect to an RDBMS (optional).
      Create a new button on a new canvas, with the code
             show_webutil_information (TRUE);
      in a WHEN-BUTTON-PRESSED trigger.
      Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
      the "Application Server URL" is empty.
      Then append "?config=webutil" at the end, so you end up with a URL of the form
          http://server:port/forms/frmservlet?config=webutil
    10) Run your form.sarah

  • How is a file attachment stored in database?

    Hi all~~
    I am developping an email application(web based) using Javamail. I need to store the attachment together with the relevant email messages in the database. Is that correct that I add an attribute called ATTACHMENT in the entity which stores the file attachment uploaded by users? If so, is the datatype of ATTACHMENT called OBJECT?
    This question confused me for more than a week already. I can send an email with the attachment which I wrote the path of the file in code, but I can't store it in the database.
    Your advice is appreciated!! Thank you!

    Hi,
    Oracle stores the BOM in basically 2 tables BOM_BILL_OF_MATERIALS and BOM_INVENTORY_COMPONENTS.
    The simplest way to explode the BOM in Oracle is to use the BOMPEXPL (BOM Exploder) package.
    Hope this helps.
    Sameer

  • Can BPEL handle file attachment from oracle database?

    Hello All,
    Need some help for this below incident.
    1. user attach a file from Human Task Work List. (this will store the attachment into the database)
    2. Get the attachment from the database.
    3. Sent it via email as attachment. (attachment can be all types of file format)
    Question.
    1. Is this possible to be done?
    2. I manage to decode and sent successful as an attachment in .txt format only. But for others i can't, any idea? i get this error in my flow (XML Parsing Error: reference to invalid character number)
    your help will helped others as well. Thanks

    Hei all.
    I get it works already. Direct copy the content from the database with the email content body.
    Problem is:
    1. PDF with large size will fail. (That's why I keep on getting error) but anyone out there know whats the size of the limit?
    2. It wont work for Text file. Its shows base64 format. I not sure why this is happen. But this can be fix with a base64 encoder.

  • Store PDF File in Oracle database 10g

    Hi all,
    I want to store PDF File in Oracle database 10g,
    and then I want to access the pdf file using Oracle Developer 6i
    can anyone tell me how to do this,
    thanks in advance.

    This question has already been posted a lot of times.....
    See the following:
    http://forums.oracle.com/forums/search.jspa?threadID=&q=pdf+file&objID=f82&dateRange=lastyear&userID=&numResults=15
    Greetings,
    Sim

  • How to read  *.pdf files and store them in a database?

    Dear programmers,
    I have problem with reading *.pdf files and store them in a database.
    can any one help me, please!
    Is it possible to read more than one file from the local system and store them in a database.
    thnaks in advance.
    bye

    What "problem" are you encountering?
    Depending on your choice of database software, it may or may not support the storage of binary large objects (BLOBs).

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • How to store Video file in Oracle9i database

    Hi
    I am working on Oracle9i Database.
    I am using Oracle9i Forms Developer for front end side.
    I want to Store a video file in a database table.
    I know that there are some data types like BLOB which support such activities but actually i dont know the exact steps of doing this task.
    Can anyone guide me in this regard that from where i have to start and how to perform this activity.
    Regards
    Ikhlaq Ahmed Khan

    Please refer to this link:
    http://www.dba-oracle.com/t_storing_insert_photo_pictures_tables.htm
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How to store text file in MySql database

    Hello Sir/Madam,
    I want to store and retreive text file in mysql database ,Please give some ideas and send me code examples.

    We keep ideas and examples of this issue here:
    http://www.google.com/search?q=mysql+jdbc+clob

  • Store links to uploaded files in mysql database

    Hello. What I'm trying to do is, let a user upload a file to my server, and lets other users download those files. I don't want to store the files in a database, because that will slooow things down. What I was wondering is how I would be able to store links to the files in the database, and let other users view them, and download them. I'm using apache tomcat, and MySQL.
    Any help would be appreciated. Thanks.

    I'm using a .jsp that uploads the files directly to my ROOT.
    This is the code for it:
    <html>
    <head><title>upload</title></head>
    <body>
    <%@ page import="java.io.*"%>
    <%
        String contentType = request.getContentType();
        if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
                    DataInputStream in = new DataInputStream(request.getInputStream());
                    int formDataLength = request.getContentLength();
                    byte dataBytes[] = new byte[formDataLength];
                    int byteRead = 0;
                    int totalBytesRead = 0;
                  while (totalBytesRead < formDataLength) {
                      byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
                         totalBytesRead += byteRead;
                    String file = new String(dataBytes);
                    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
                  saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
                  saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
                    int lastIndex = contentType.lastIndexOf("=");
                    String boundary = contentType.substring(lastIndex + 1,contentType.length());
                    int pos;
                 pos = file.indexOf("filename=\"");
                 pos = file.indexOf("\n", pos) + 1;
                 pos = file.indexOf("\n", pos) + 1;
                 pos = file.indexOf("\n", pos) + 1;
                   int boundaryLocation = file.indexOf(boundary, pos) - 4;
                    int startPos = ((file.substring(0, pos)).getBytes()).length;
                    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
                    String filepath=session.getServletContext().getRealPath("/")+saveFile;
                    FileOutputStream fileOut = new FileOutputStream(filepath);
                fileOut.write(dataBytes, startPos, (endPos - startPos));
                fileOut.flush();
                fileOut.close();
                out.println("File saved as " +saveFile);
    %>
    <!-- Starts Here -->
    <form method="post" ACTION="upload.jsp" name="uploadForm" ENCTYPE='multipart/form-data'>
    <input type="file" name="uploadfile" />
    <p>
        <input type="submit" name="Submit" value="Submit">
        <input type="reset" name="Reset" value="Reset">
        <input type="hidden" name="action" value="upload">
    </p>
    </form>
    <!-- Ends Here -->
    </body>
    </html>
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When group-working from SAN, where is the best place to store Cache Files, the Cache Database, and render files?

    I have a small post production house, and we are spinning up into editing our first series. We're all working from a SAN, and sharing projects and sequences via the Media Browser. It's working great so far, but we've been having issues (could be user error) with trying to figure out where best to store the Media Cache database, the cache files, and the preview files so when a project is moved from one machine to another, it doesn't constantly have to re-conform all of the media in the project.
    We have a very large master project, as this is a documentary style show, so there are hours and hours of clips.
    When I open a project on a new or different machine it has to conform EVERYTHING in the project again.
    Where should I store all these conform and cache files so that new people can get started working without having a machine literally be unusable until the conform process finishes?
    Thanks!

    Hi Jon,
    I have a small post production house, and we are spinning up into editing our first series. We're all working from a SAN, and sharing projects and sequences via the Media Browser.
    Glad it is working for you. Just to let you know, this workflow is not officially supported so your mileage may vary based on the kind of system you're working with. There are a lot of variations to the quality of these kinds of systems. Some are turn key, some home built - so I think you understand.
    It's working great so far, but we've been having issues (could be user error) with trying to figure out where best to store the Media Cache database, the cache files, and the preview files so when a project is moved from one machine to another, it doesn't constantly have to re-conform all of the media in the project.
    While it's possible to have the cache files (and the database) in a central location (I only know of one place that pulls that off, and it's a very, very large place), the systems that have this data stored locally are far more reliable. You can work around all the reconfirming by avoiding moving the project data around. You really don't need to move the project around from place to place. Have one computer as the "hub" for inputting data from other workstations. Wouldn't that work?
    When I open a project on a new or different machine it has to conform EVERYTHING in the project again.
    Can't you just have the master project on one machine and work on shorter sequences of your doc on the other machines? When done, just import to the master machine.
    Where should I store all these conform and cache files so that new people can get started working without having a machine literally be unusable until the conform process finishes?
    Premiere Pro simply must have those cache files in order to work. Sorry, there's no way around this problem unless you change your workflow.
    Thanks,
    Kevin

Maybe you are looking for

  • Image is not printing in PrintAdvanceDataGrid when the PrintAdvanceDataGrid was added to Vbox

    I tried to print the image in the PrintAdvance Data Grid  , image is not priniting  when the PrintAdvanceDataGrid was added to Vbox or Vgroup, can any one help?

  • Windows nor iTunes does not recognize iPod anymore

    I have a major problem that I can't comprehend. OK, so my hard drive did some weird stuff on me and I had to repair it. Afterward, a whole bunch of things got messed up so I had to repair my Windows XP installation. And now, when I connect the iPod,

  • Itunes Wont Download from Apple Site

    itunes won't download from the Apple iTunes page.  Apple website states, "Thanks for downloading.  You're only a few steps away from enjoying"  but the site doesn't show any steps to take, just product info. and the program does not show on my comput

  • Calling a function in a loop

    Hello, I have something like this:          declare          cursor c is            select 2,3,4 from dual;          begin          for r in c loop            dbms_output.put_line( prod_stb(81852225, r, 'STB 1 HORECA'));          end loop;          e

  • Use of Containers in BPM

    hey guys wats the main use of container elements in BPM,i know they are used as variables to store value during the design time but wat purpose they serve by storin values,also do we need to have separate containers for every step in BPM? thanx ahmad