Pdf as blob in DB

Dear All,
I have an application developed in oracle forms 10 g .
In the forms , On Button Press , I and generating a report in PDF using
web.show_document('/reports/rwservlet?&report=CBSALPDR.rep&desformat=pdf&destype=cache'|| .........)
The report is getting previews in PDF without any problem.
Now the users wants to insert this PDF report into the database and keep it for future reference.
Is there any way to do this ?
Kindly help
Thanks
Ajith

hi ajith,
could you pls help me that how to load bfile in apex (oracle application express).
pls let me know coding and all procedure.
thanks

Similar Messages

  • To store PDF into BLOB and retrieve into OLE/OCX

    We would like to:
    1. Store a PDF file (output of a report saved in file server) into a BLOB
    column.
    2. Retrieve previously stored PDF in the BLOB column and display using either
    OLE automation or ActiveX (OCX) control.
    I read all related documents in metalink that addresses this issue however cant
    get this to work. We have Acrobat Reader 4.0. Here are some issues from the
    tests that I did:
    1. To load the PDF file the program code that uses BFILE and LOADFROMFILE does
    not work since the database is on a remote server and the PDF file is on a
    local file server. The DIRECTORY created on the database is unable to find the
    PDF file.
    2. Though I want the loading of the file to be programmatic, I tried
    right-click on the OLE container and inserted object from file. This loaded the
    file into the container (Icon on the container appeared) however I was not able
    to view the document by double-clicking. An error in Adobe occured: 'There was
    an error opening this document. A file read error occured'. My guess is the
    'Insert Object' did not insert the file properly into the BLOB.
    3. When trying to display the PDF file stored in file server (in case storing
    into BLOB does not work), I used an OCX control, right-clicked and Insert
    Object and select Adobe Control for ActiveX. The problem here is when I run the
    form, the OCX control shows up empty and I have to 'Insert Object' again in
    runtime. Once I manually insert object from runtime the GET_INTERFACE POINTER &
    SET_PROPERTY works fine is displaying the document. Is there any way to
    maintain the control property of the OCX when the form is run?
    4. Are there any workarounds and better solution to store PDFs into BLOBs and
    retrieve and display in OLE/OCX controls? Using temporary file into local drive
    is not an issue.
    5. Would I be able to make use of 'PDF.PdfCtrl.1' OLE class?
    6. Does OLE automation work for Acrobat Reader 4.0.?
    I would appreciate all the help.
    Shyam

    Im facing a similar kind of problem. I want to store and retrieve Office files, PDF and Jpegs into/from the database to view them on web in disconnected mode. Please reply as I cant find any help/documentation regarding saving BLOB data into files. I was able to store file data into BLOB, using DBMS_LOB package.
    Shahzad

  • How to load externl files (PDF) into BLOB column.  Please help.

    Hi All,
    I've currently been working on loading many external binary files (PDF) into BLOB column. After some digging, I learn that the SQL*LOADER can be used to load data from external files into table. I also got help from another forummate mentioning to use PL/SQL procedure to do so. Since I have not done anything like this before. So, my question is what is the simple approach needed to upload PDF files into a table(there is only one table containing BLOB column in my database). In addition, the LOBs can not be query-able, I wanted to list the contents of the LOBs column to make sure that I did successfully upload data into the database. How can I do that?. I do need your help. Please direct me step by step how to do so. Your help is greatly appreciated.
    Regards,
    Trang

    Hi,
    If the following link helps to you then great.
    http://www.exefind.com/oralobeditor-P25468.html
    Regards,
    Sailaja

  • Uploading PDF in to BLOB and Retrieve PDF from BLOB

    hi
    I have recently started working in apex and run into a bump while trying to handle PDF file Attachments and BLOBs.
    I am trying to upload a PDF file into BLOB database Column using APEX, and later view this file from DB.
    I require assistance on how to upload PDF file into BLOB, and how i can later view this inside the browser window, using APEX
    thanks

    Maybe this blog post can help you.
    Regards,
    Sergio

  • How to store pdf into blob, index it and search it?

    I am trying to store pdf into a column, index the column and search it.
    I store pdf file into blob column with either the following code or with an interface in apex
    declare
    Dest_loc BLOB;
    Src_loc BFILE := BFILENAME('DIR_TESTCASE', 'intermedia.pdf');
    BEGIN
    INSERT INTO pdffiles(id, description)
    VALUES(1, 'InterMedia Concepts')
    RETURN text INTO Dest_loc;
    DBMS_LOB.FILEOPEN(Src_loc, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, dbms_lob.getlength(Src_loc));
    DBMS_LOB.FILECLOSE(Src_loc);
    COMMIT;
    END;
    then i need to create an index
    begin
    ctx_ddl.create_preference('pdf
    lexer', 'BASICLEXER');
    ctx_ddl.set_attribute('pdf_lexer', 'printjoins', '_-');
    end;
    create index PDFFILES_TEXT on PDFFILES(TEXT) indextype is ctxsys.context
    parameters ('lexer pdf_lexer');
    sqlplus says index created but windows gives an error and closes ctxhx.exe
    and of cource when I tried to make a search like
    select id, description
    from pdffiles
    where contains(text,'Oracle') > 0;
    it doesn't return any results.
    My database is 10g XE, I also tried it on Oracle 10.2.0.3 EE

    It is possible to store pdf and doc files in a blob column, create a text index, and search them, and display them. However, you cannot expect to just select doc and pdf data directly from a blob column and expect to be able to read it, due to all of the special formatting characters. You need to use ctx_doc.snippet or ctx_doc.markup or some such thing to format it and make it readable. Please see the demonstration below. You can search the online documentation for complete syntax, additional information, and examples.
    SCOTT@orcl_11g> CREATE TABLE my_files
      2    (id   NUMBER,
      3       doc  BLOB)
      4  /
    Table created.
    SCOTT@orcl_11g> CREATE OR REPLACE DIRECTORY DIR_TESTCASE AS 'c:\oracle11g'
      2  /
    Directory created.
    SCOTT@orcl_11g> declare
      2    Dest_loc BLOB;
      3    Src_loc     BFILE;
      4  BEGIN
      5    INSERT INTO my_files (id, doc) VALUES (1, EMPTY_BLOB())
      6    RETURNING doc INTO Dest_loc;
      7    Src_loc := BFILENAME ('DIR_TESTCASE', 'banana.pdf');
      8    DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
      9    DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
    10    DBMS_LOB.FILECLOSE (Src_loc);
    11    INSERT INTO my_files (id, doc) VALUES (2, EMPTY_BLOB())
    12    RETURNING doc INTO Dest_loc;
    13    Src_loc := BFILENAME ('DIR_TESTCASE', 'test1.doc');
    14    DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
    15    DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
    16    DBMS_LOB.FILECLOSE (Src_loc);
    17  END;
    18  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> INSERT INTO my_files (id, doc)
      2  VALUES (3, UTL_RAW.CAST_TO_RAW ('blob data for id 3'))
      3  /
    1 row created.
    SCOTT@orcl_11g> COMMIT
      2  /
    Commit complete.
    SCOTT@orcl_11g> SELECT id, DBMS_LOB.GETLENGTH (doc) FROM my_files
      2  /
            ID DBMS_LOB.GETLENGTH(DOC)
             1                  222824
             2                   19968
             3                      18
    SCOTT@orcl_11g> CREATE INDEX my_files_idx ON my_files(doc)
      2       INDEXTYPE IS CTXSYS.CONTEXT
      3  /
    Index created.
    SCOTT@orcl_11g> SELECT COUNT (*) FROM dr$my_files_idx$i
      2  /
      COUNT(*)
           308
    SCOTT@orcl_11g> COLUMN first_45 FORMAT A45
    SCOTT@orcl_11g> SELECT id,
      2           UTL_RAW.CAST_TO_VARCHAR2 (DBMS_LOB.SUBSTR (doc, 18, 1)) AS first_45
      3  FROM   my_files
      4  /
            ID FIRST_45
             1 %PDF-1.5
    %âãÏÓ
               1
             2 ÐÏࡱá
             3 blob data for id 3
    SCOTT@orcl_11g> EXEC CTX_DOC.SET_KEY_TYPE ('ROWID')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> COLUMN keywords_in_context FORMAT A45 WORD_WRAPPED
    SCOTT@orcl_11g> SELECT id,
      2           CTX_DOC.SNIPPET
      3             ('MY_FILES_IDX',
      4              ROWID,
      5              'contents OR (fruit of the month) OR data',
      6              '<<',
      7              '>>')
      8             AS keywords_in_context
      9  FROM   my_files
    10  WHERE  CONTAINS (doc, 'contents OR (fruit of the month) OR data') > 0
    11  /
            ID KEYWORDS_IN_CONTEXT
             1 <<Fruit of the Month>>
               Banana
               Bananas are the most popular
             2 This is the original <<contents>> of
               test1.doc.
             3 blob <<data>> for id 3
    SCOTT@orcl_11g>

  • Newbie Upoad PDF to blob then Delete File.pdf

    I want the user to upload A PDF and import it into A BLOB.
    That part is working.
    If the user uploads the WRONG PDF, I want them to be able to delete the FILEA.PDF.
    They can delete the FILEA.PDF, if they wait 4 or 5 minutes.
    Delete the FileA.PDF is the part that is not working, if the user does it in less
    than 4 or 5 minutes.
    The PDF is about 60K.
    Below is the sample code:
    =========================
    <code>
    SELECT mypdf
    INTO temp_blob
    FROM fcsImpactUpload
    where renname= 'FileB.PDF'
    FOR update;
    IF dbms_lob.fileexists(src_file)=1 THEN
    dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
    lgh_file := dbms_lob.getlength(src_file);
    dbms_lob.loadfromfile(temp_blob, src_file, lgh_file);
    UPDATE fcsImpactUpload
    SET de_pdf = temp_blob
    where renname= 'FileB.PDF';
    COMMIT;
    END IF;
    UTL_FILE.FGETATTR('AIMSORAPDF', 'FileA.PDF', DOESEXIST, FLEN, BSIZE);
    IF DOESEXIST THEN
    UTL_FILE.FREMOVE('AIMSORAPDF','FileA.PDF');
    ELSE
    EXIT; -- File does not exist
    END IF;
    </code>

    Forget to say verasion
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE     10.2.0.4.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

  • Output pdf to blob

    HI:
    I am using Apex 3.2 and pl_fpdf to generate pdf reports. I have the pdfs working very well.
    By default, the pdfs are sent to the browser. In most cases this is fine. But, in one specific case I wasnt to generate the pdf and attach it to an email.
    I assume that I need to output the pdf to a blob and then attach it to the email?
    Does anyone know how I can output the pdf to a blob instead of to the browser?
    Thanks.
    Bruce

    See the FAQ's from PL/PDF's website (http://plpdf.com/#/support/faq) in particular:
    What can I do with the generated PDF file?
        PL/PDF returns the PDF file in a BLOB variable. This return value can be used in the following way:
        * Store the BLOB variable containing the PDF file in the database to display later or to archive.
        * Display the PDF file in a browser using a Web Server that has MOD_PLSQL capabilities.
        * Send the PDF file as an e-mail using PL/SQL’s mail extension.
        * Save the PDF file to a computer.Thank you,
    Tony Miller
    Webster, TX

  • Pdf from blob directly to webbrowser control without file create ???

    my client(c#) fetches a blob filed from db containing a pdf document
    if i save the fetched byte data in a file and set webBrowser.Navigate(fileSavedLoc); the pdf is displayed in the webbrowser control
    is there a possibility to avoid the file create and show the fetched pdf byte stream directly in the webbrowser control (maybe by creating a html doc) ?
    thx

    Hi,
    This is more of an ASP.NET question than an Oracle question.
    As I understand it though, you'll want to create a Handler for that. There's an example of one that processes images stored in a database if you create a new Personal WebSite in VS2005 or VWD ( File > New > WebSite > Personal Web Site ). Look at Handler.ashx... in a nutshell it calls PhotoManager.GetPhoto to get the bytes of the picture, then passes those to the OutputStream with ContentType of "image/jpeg". You could do the same for pdf.
    You'd then just call Handler.ashx with a query string to identify the pdf you need.
    Hope it helps, corrections welcome.
    Greg

  • Pdf file - BLOB

    Hello All,
    To store a pdf file in a BLOB column.
    create table test
    id number primary key,
    docs BLOB
    create or replace directory doc_loc
    as 'c:\test';
    insert into tkctsf15t values(1,empty_blob()) returning docs
    into dest_loc;
    dbms_lob.open(src_loc,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(
    dest_lob => dest_loc
    ,src_lob => src_loc
    ,amount => DBMS_LOB.getLength(src_loc));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_loc);
    COMMIT;
    end;
    exec Load_BLOB_From_File('test.pdf');
    ORA-06550: line 1, column 7:
    PLS-00905: object PRJ.LOAD_BLOB_FROM_FILE is invalid
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Any help!
    Thanks,
    S!G

    If your c:\test directory is on your server and appropriate privileges exist, then the code below should work. If your c:\test directory is on your client, then you will need to load the files with SQL*Loader.
    SCOTT@orcl_11g> create table tkctsf15t
      2    (id    number primary key,
      3       docs  BLOB
      4  )
      5  /
    Table created.
    SCOTT@orcl_11g> create or replace directory doc_loc
      2  as 'c:\test'
      3  /
    Directory created.
    SCOTT@orcl_11g> CREATE OR REPLACE PROCEDURE load_blob_from_file
      2    (src_file IN VARCHAR2)
      3  AS
      4    dest_loc     BLOB;
      5    src_loc         BFILE := BFILENAME ('DOC_LOC', src_file);
      6  BEGIN
      7    insert into tkctsf15t (id, docs)
      8        values (1, empty_blob())
      9        returning docs into dest_loc;
    10    dbms_lob.open
    11        (src_loc,
    12         DBMS_LOB.LOB_READONLY);
    13    DBMS_LOB.LOADFROMFILE
    14        (dest_lob => dest_loc
    15        ,src_lob  => src_loc
    16        ,amount   => DBMS_LOB.getLength(src_loc));
    17    DBMS_LOB.CLOSE (src_loc);
    18    COMMIT;
    19  end load_blob_from_file;
    20  /
    Procedure created.
    SCOTT@orcl_11g> SHOW ERRORS
    No errors.
    SCOTT@orcl_11g> exec Load_BLOB_From_File ('test.pdf')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> SELECT id, DBMS_LOB.GETLENGTH (docs)
      2  FROM   tkctsf15t
      3  /
            ID DBMS_LOB.GETLENGTH(DOCS)
             1                   222824
    SCOTT@orcl_11g>

  • Store pdf in blob

    can any one tell me how to store a pdf file in the blob.
    I m using forms 10g rel2 and oracle xe 10g.

    Hello Master,
    <p>Have a look at this one</p>
    Francois

  • SAVE PDF IN  BLOB

    Hi; I am using the package PL_FPDF to save PDF rapport in DB. I create a procedure to do it and it work when I do it for one record .
    but when I use a loop to save the PDF in lob for more one record. it work without image in PDF, but with image it just save the first PDF of the loop process, and the other record it create an empty PDF in the lob table. when I compile the PL_FPDF it work for the second. etc. so if I want to save 10 record one after other, I must compile for each time the PL_FPDF not my procedure . I think that the BLOB used in the package was the problem. I change this instructions into all the package
    dbms_lob.createtemporary(vlob, true,dbms_lob.session);
    By
    dbms_lob.createtemporary(chunk_content, true,dbms_lob.call ); but without result.
    I need a solution for it do this task with loop. I hope you understand my question. thanks for your suggestions.
    best regard.
    Hakim

    No; I means I create a procedure with PL_FPDF that generate a PDF who contain image, (logo for example )after generating , I save this file in blob field from my Table(using update). it work fine. I have 2000 record I want to generalize this procedure to put for eatch record the PDF corresponding, with some parameter (of course it is not the same PDF in eatch record). It work fine when My PDF have note image.
    But when there was an image in the PDF. this procedure does not work. I Have the update in the 2000 record but only the first one have a full PDF, the rest there is an empty PDF.
    So I think in the package PL_FPDF. there is some thing to modify for image process.
    I hope it is more clear.
    thanks for responding.
    Best regard.
    Hakim

  • Is possible to preview a file (pdf, doc) (BLOB col)  in a popup windows.

    Hi all,
    About 1 million documents stored in a BLOB column. My requirement is to be able to add in a Report
    a preview picture of the file in the BLOB, like print preview. The best solution might be a snapshot of the first 10 rows ...just to understand type of document and Title
    Regards,
    Giuseppe.

    Hi Govindu,
    This is what I am doing.
    1. I have created a push button.
    2. I have selected the system action as hyperlink
    3. I have provided the following url for test in the hyperlink : "http://www.google.com"
    4. Saved, compiled and deployed but the button doesn't show any behavior when clicked.
    Am I missing something?
    Regards,
    Murtuza

  • How do you Display a PDF stored as a BLOB in Apex?

    We are trying to use Apex for the first time here in our shop. The project we have selected has PDFs stored on the database as BLOBS that we currently are able to display with our forms application. We want to do this using apex, and have them appear on one of the pages in the application. I want the PDF to display on the page, when the page itself is invoked, without the need to click on a download link on the page itself.
    I've seen certain examples displaying images etc, but I haven't found one that specifically refers to the display of a PDF database BLOB on a page (I assuming a report page) within Apex.
    Also, since I've just set up the Apex environment utilizing Oracle HTTP Server in the middle tier, do I need Oracle's BI Publisher in order to display the PDFs in Apex?
    Thanks in advance. Any advice or links would be much appreciated.
    Phil

    Thanks for the quick response, and you are correct. I've seen examples that include a link to specifically display the PDF, but I don't want them to be able to directly go to the PDF outside the context of the page itself. These are letters of recommendation that we store on our DB, and this application, for our med school admissions screeners, will be looking at up to three letters of recommendation for each applicant to which they have been assigned. We want them to click on an applicant, and then through a series of tabs view data on that applicant, some of which will be his/her letters of recommendation.
    Phil

  • Read/Write pdf's as blobs using forms 10g

    Hi All,
    I have a table called IMAGES in which i store the pdfs as blobs.
    It was successfully working fine with me when I was using forms 6i.
    Recently I installed oracle 10g and just found that 10G doesnt support OLE.
    I came to know about WEBUTIL package and I have already included in the form.
    Could you please help me out how can utilize this WEBUTIL package to read/write blobs from database.
    If you have already developed any code like that, could please forward me?

    The WebUtil_file_transfer.client_to_db and db_to_client will give you direct access to read and write to the blob - I think the Demo form on
    http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm
    has an example of this

  • Loading external (PDF)file into BLOB colum in the table.  Need urgent help.

    Hi All,
    I've currently been working on loading many external binary files (PDF) into BLOB column. After some digging, I learn that the SQL*LOADER can be used to load data from external files into table. I also got help from another forummate mentioning to use PL/SQL procedure to do so. Since I have not done anything like this before. So, my question is what is the simple approach needed to upload PDF files into a table(there is only one table containing BLOB column in my database). In addition, the LOBs can not be query-able, I wanted to list the contents of the LOBs column to make sure that I did successfully upload data into the database. How can I do that?. I do need your help. Please direct me step by step how to do so. Your help is greatly appreciated.
    Regards,
    Trang

    Once the PDF file is inserted in the PDM table, i am not able to read the PDF data from the below code, This code converts the binary data into the Character data i.e BLOB data into the CLOB, but still the data is not proper which is getting inserted PDF is proprietary format of Adobe. And you cant just read it from pl/sql. You need Adobe software installed in your client machine to view it.
    Here is an example of how to do it.
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006] Display PDF Stored in Database from ASKTOM 

Maybe you are looking for

  • HP Compaq web cam is not working

    I have Hp Compaq  Notebook 620. The devices have 2MP Web Cam but the Web Cam is not working. When i try to make it on, its shows error "No webcam detected. HP Webcam will now Close"  Please suggest the solution of the problem.

  • Dreamweaver CS5 to CS6

    I use to have Dreamweaver cs5 and I had created 2 websites from the program.  I now have Dreamweaver cs6 but I do not know how to import my recent webpages into cs6.  My webpage folders are on my desktop but when I click import site the open button i

  • Project controlling with Solution Manager

    Dear SolMan community, we just finalized in a SAP Retail implementation project the planning for the release phase. Input for the planning activities were numerous functions that were already created in SolMan. We decided to use Excel to conduct a bo

  • What is AS for playing external video ?

    Hello, This is probably very basic question, but that just proves the fact that I struggle with AS. I would like to place a thumbnail picture on my web page, which would take the viewer ( when he clicks on it ) to the external video file, which is lo

  • Excel as default...

    I have Excel on my Mac, but Numbers always opens by default when I download spreadsheets.  I'm not really getting on with Numbers and copying data from Numbers to Excel is a real pain.  I love my Mac but I really can't be bothered to learn Numbers wh