Insert PDF or Doc file to the Database from Frontend

Hi
I am in ISB company working with Oracle 9iDS. The scenario is to me that I would like to insert some document files(especially Pdf formated files) to the database.
I can use Read_Image_file. but that is used for the image file to bring the image file from physical location to my application, how it is for PDF?
and how can i save it in the database?
thanks
farhad

So are you saying you want to load a file from the pc/client to the database - then you can use webutil.
see otn.oracle.com/products/forms
Regards
Grant Ronald
Forms Product Management

Similar Messages

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

  • 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 to display the PPT, PDF, XL, DOC files with in the Windows store app?

    Hi,
    I would like to display the PPT, PDF, XL, DOC files with in the Windows store app? is there any controls provided by Microsoft to view these files with in the app?
    Or
    Any workaround to achieve the desired functionality?
    Kindly provide your inputs if any one has.
    Regards
    Prasad

    Hi Prasad,
    As I know currently there is no in-build functionality to display the PPT, XLS or DOC file directly on the Windows Store App, but you can always open these files by
    Launcher class
    However a good news is we can display PDF on Windows Store App by
    Windows.Data.Pdf class, see this for more information:
    https://code.msdn.microsoft.com/windowsapps/PDF-viewer-showcase-sample-39ced1e8/
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Inserting html or doc file in database

    Can I send an HTML or DOC file to Oracle database? The file houses text data along with some images and I'd like to send whole this file to database. Could anyone help me do this?
    Thanks

    Thanks...you are right, the html file contains references to images and I've been able to distinguish all images of the JEditorPane and send those to database. Now I need to send the text contens of JEditorPane to database. Problem is the text data can't be taken differently. If you do have any idea of tracing only the text contents, please let me know.

  • Saving a PDF or DOC file into Oracle 9i using Developer Forms 10g

    Hi guys,
    I want to save a pdf or doc file into oracle 9i. I am using Developer 10 g. Please help me;
    1. What datatype field should be in database table to store such file.
    2. Which code should I use in Forms 10g to display open file dialog, get the name and save that into database table.
    Thanks in advance

    WEBUTIL is a library used with forms to interact with the client. With Forms10G the library comes shipped with the developer suite, for forms 9i i'm not sure, check the forms-page at otn if there is any download available. For documentation about how to do a file-upload, simply search the forum, there are lots of examples.

  • Link to trigger a .pdf or .doc file to show in presentation

    I would like to add a link that would trigger the showing of a .pdf file or a .doc file within the presentation itself. I can do this in powerpoint. There must be some way to do this in Keynote, but I can't figire out how to do this. Thanks for any ideas.

    Keynote does not allow links to anything but other Keynote presentations, websites, or email. However, you can use Expose or Command-Tab to quickly switch to a PDF or Word file.

  • Can not open .pdf or .doc files in mail

    Every time I receive an email with a pdf or .doc file attached I can never open it as I get a message telling me that the file was not recognised or that the file is invalid. Even if I select to open using Adobe for the pdf I get the same.
    Any help gratefully received. I've always had this problem and get round it by viewing these emails online instead. But it's not as convenient of course.

    G'day jbglass,
    I had the same problem, getting the same error message etc. I solved the problem by going to Google Chrome and using that to download the file ( a pdf brochure in my case).  That worked OK.  Hope this helps.
    fitzlefrog

  • To open a Excel and Doc file inside the AIR application

    How to open a Excel and Doc file inside the AIR application.  I have opened the PDF file inside the AIR application.  But i got stuck in opening the Exce and Doc file.  Please help me in this issue.

    AIR does not support this inherently. However, you could write code to parse these file formats. For example, the following is an ActionScript 3.0 library for reading and writing Excel files:
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1375018

  • Opening attached .pdf and .doc files

    I am having a mental moment and can't figure out how to
    (attach to button) import .pdf or .doc files so that they open when
    the project is published. The buttons are linked to files on my
    computer...when I publish, Captivate knows the files are there and
    tells me:
    "The files/projects listed below are linked to the open
    project. The linked files/projects may require exporting.
    It is also important to copy all referenced files and
    projects with their corresponding HTML files to the output folder."
    1. How do I export the linked files?
    2. What output folder is it refering to?
    Thanks in advance...I'm obviously new to captivate.
    js

    Hi again js
    Certainly linking to the documents from MenuBuilder is one
    approach.
    Are you saying the links from Captivate are failing you? You
    may wish to try a technique I outlined in
    this
    thread.
    Cheers... Rick

  • Previewing pdf and doc files

    Does anyone know the best way to go about showing pdf and doc files as a document preview within a Swing panel?
    Thanks in advance for your advice!
    Sarah

    You can do it with iText PDF. Go through it's tutorial. It is easy.
    iTextPDF

  • Attach .pdf and .doc files to Reply emails.

    I am desperately trying to figure out how to attach .pdf and .doc files to Reply emails in the Mail app. I have downloaded GoodReader, but when I go into "Manage Files" and choose "Open in...", Mail is not one of the apps listed for me to choose from (only Quickoffice and iBooks are listed, that's it). My Gmail account is pushed to the Mail app, if that's relevant at all.
    I'm hoping to be able to attach documents to Reply emails in the Mail app, but if I have to do it using my web-based email, that's better than nothing. I just really need to be able to attach them to Replies, and not compose a new email from scratch.
    I'd REALLY appreciate any help with this!
    Thanks.

    I thought I might be able to figure out a clever work-around by using cut and paste from a new message but this did not work as expected. I have been using the MobileMe iDisk app to store pdf files and then just mailing out the links.  I believe my cut and paste method would have worked with this, however I've got about a year now to figure out another way to do this if it is not included in Apple's new cloud service. This has actually been a better as I need to worry less about file size and don't need to have the files stored on the device.
    You may want to look into what on-line file storage solutions are out there and if they have the ability to send links to files to colleagues, possibly with password protection.

  • Can i view and edit PDF and .DOC file on iphone?

    Actually I got 2 question to ask,
    firstly have anybody got any luck to view PDF and .DOC file on Iphone because i have been trying for aged but there was no luck for me. I'm not talking about went to a email that contain a PDF or .DOC file but something like going to a website that let me able to download a PDF/.DOC. When I tried to download the file, safari keep saying that "It can not be download"??
    secondly, when is that going to be available to install third-party application to iphone such as Skype, IM+..
    appreciated everybody.

    You cannot download anything on the phone as it is not supported
    Third party applications support will start after the SDK(software development kit) is released in February

  • .pdf and .doc files corrupted on 2 Macs?

    On an iMac and a shared Mac Mini, a number of PDF and DOC files have all of a sudden gotten corrupt. Some of these have not been modifed in 2 years but all of a sudden are corrupt. I've tried Data Rescue and cannot find anything online about these multiple files getting corrupted. I've rebuilt permissions and done various ML Cache Cleaner options to no avail. Anyone heard of anything like this? It just happened all of a sudden on 2 computers. At first I figured the first computer had the partition going bad but that doesn't explain 2 computers at once.

    Dear M.V,
    with the same above configuration, now I am able to open pdf's which are having a size lessthan 2 MB.
    below is the access log
    127.0.0.1 - - [13/Feb/2008:15:04:36 +0530] "GET /pdfcheck.php?file=CampusMap HTTP/1.1" 200 2000000 below is the error log
    [13/Feb/2008:15:10:49] warning ( 3288):  for host 127.0.0.1 trying to GET /pdfcheck.php, finish-response reports: HTTP2228: Response content length mismatch (2000000 bytes with a content length of 2535786)  php code
    <?php
    if(!isset($_GET['file']))die('LOGGED! no file specified');
    $file_path=$_SERVER['DOCUMENT_ROOT'].'/pdfs/'.strip_tags(htmlentities($_GET['file'])).'.pdf';
      $file_name = $_GET['file'];
    $mm_type="application/pdf";
    header("Cache-Control: public, must-revalidate");
    header("Pragma: hack");
    header("Content-Type: " . $mm_type);
    header("Content-Length: " .(string)(filesize($file_path)) );
    header('Content-Disposition: inline; filename="'.$file_name.'"');
    header("Content-Transfer-Encoding: binary\n");
    readfile($file_path);
    ?>Thanks
    madhu

  • How to import an .csv file into the database?

    and can we code the program in JSP to import the.csv file into the database.

    It is better to use Java class to read the CSV file and store the contents in the database.
    You can use JSP to upload the CSV file to the server if you want, but don't use it to perform database operations.
    JSPs are good for displaying information on the front-end, and for displaying HTML forms, there are other technologies more suitable for the middle layer, back end and the database layer.
    So break you application into
    1) Front end - JSPs to display input html forms and to display data retrieved from the database.
    2) Middle layer - Servlets and JavaBeans to interact with JSPs. The code that reads the CSV file to parse it's contents should be a Java Class in the middle layer. It makes use of Java File I/O
    3) Database layer - Connects to the database using JDBC (Java Database Connectivity), and then writes to the database with SQL insert statements.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Keeping the above concepts in mind, first build a simple JSP and get it to work,
    then research on Google , for Java File I/O , discover how to read a file,
    Then search on how to readh a CSV file using Java.
    After researching you should be able to read the CSV file line by line and store each line inside a Collection.
    Then research on Google, on how to write to the database using JDBC
    Write a simple program that inserts something to a dummy table in the database.
    Then, read the data stored in the Collection, and write insert statements for each records in the collection.

Maybe you are looking for