Storing PDF and Word document in oracle database

any idea, how to store PDF and word document using oracle database.
thanks

The common approach is store as BLOB in database, use DBMS_LOB package to handle the loading and reading, sample script source asktom
Also check this thread in Asktom
SQL> create table demo
  2  ( id        INT PRIMARY KEY,
  3    theBlob   blob,
  4    dummy_col VARCHAR2(1)
  5  )
  6  /
Table created.
SQL> -- --------------------------------------------------------------
SQL> -- Load a PDF file into a BLOB field and compress the BLOB.
SQL> -- --------------------------------------------------------------
SQL> declare
  2      l_blob    blob;
  3      l_bfile   bfile;
  4 
  5  begin
  6      insert into demo (id, theBLOB) values ( 1, empty_blob() )
  7      returning theBlob into l_blob;
  8 
  9      l_bfile := bfilename( 'BLOB_DIR', 'Test.PDF' );
10      dbms_lob.fileopen( l_bfile );
11 
12      dbms_lob.loadfromfile( l_blob,
13                             l_bfile,
14                             dbms_lob.getlength( l_bfile ) );
15 
16      UPDATE demo
17      SET    theBlob = utl_compress.lz_compress(l_blob, 6)
18      WHERE  id = 1;
19  -- If you don't want compress the LOB just update directly
20      dbms_lob.fileclose( l_bfile );
21      COMMIT;
22  end;
23  /
PL/SQL procedure successfully completed

Similar Messages

  • Urgent Help Regarding PDF and Word Document Downloading

    Many Thanks Shaik for you humble help. Actually now what I did in the past 3 days,
    I used Oracle Intermedia to store my PDF and Word Documents in the database using Oracle SQL Loader. Then I used PL/SQL Server Pages and Oracle Web Toolkit for the downloading of my documents.
    Now the problem is I saved all my formatted documents in the databse and for retrieval I am using following code in my stored procedure
    * Select BLOB Data
    select blob_data into myblob from mytable where blob_name = name;
    Setup headers which describes the content
    owa_util.mime_header('text/html', FALSE);
    htp.p('Content-Length: ' || dbms_lob.get_length(myblob));
    owa_util.http_header_close;
    Initiate Direct BLOB download
    wpg_docload.download_file(myblob);
    end;
    The structure of the mytable table:
    create table mytable
    doc_id varchar2(128),
    doc_name varchar2(128),
    blob_data blob
    But when it prompt the client to download the file actually it gives the junk file name like 'B104ea56' (which i understand is the address of the blob address). What I want is to show the "SAVE AS" download box with the proper document name which is stored in my field in the following way
    1 SALES.PDF
    2 PLANNING.PDF
    3 MANUAL.DOC
    4 STANDARD.TXT
    If I set the MIME type for the file format than it automatically starts download the file to the client browser, that I do not want, It should ask the user to download with the proper document name.
    Waiting consiously for your help
    Regards

    Presumedly you'd like those documents being accessiable by users as well, so they should be put on a web server, ftp or nfs sharing. You can just add the urls to those documents, or the directory they are in, into robot system as starting points and let robot run to collect them.

  • Hot to display PDF and Word documents as an attachment in OBIEE Reports

    Hi,
    From few of Oracle threads I learnt that we can store the files in a server locaiton and read it thro a URL. What I am trying to do is, PDF or Word document will be stored in database as BLOB fields. This BLOB field needs to be come as an attachment in OBIEE Reports and by clicking that icon, it uses the local applicaiton PDF reader or a word applicaiton and open the attachment, just like how we open an attachment from a E-mail. Can you please help me with the possible methods of that. I can provide you more information incase if you need.
    Thanks
    Augesthi

    As long as you used the paper-clip Attach icon, that should be fine.
    The entire document appears to you because your Mac recognizes the document type, and displays it for you, saving you from having to mouse around and find a Reader for it. You can still use the Save icon to save a copy of only the attachment.
    To avoid problems with other email readers, be sure the checkbox [√] send windows-friendly attachments is checked.
    I addition, some email readers cannot cope with any attachments positioned at any place in the document other than at the very end. So make sure you move the cursor to the absolute end of the document before clicking "Attach".
    If all else fails, send an email that says, "attachment to follow", then send the attachment right away in a separate email, with nothing else in the body of the message. Some use the Subject abbreviation (nt) to indicate "no text", that is, no words typed in the message portion.

  • PDF and Word Documents

    I have a requirement to retrieve either a PDF or a Word document from the database, and eventually display it in my JavaFX 2.2 application.
    I had been looking out for ideas and falling short. Any hints on how this could be implemented would be highly appreciated.
    Thanks.

    Thanks for the response jsmith. Please see my comments inline.
    jsmith wrote:
    Use the associated application installed on the client to display the file:
    http://docs.oracle.com/javase/7/docs/api/java/awt/Desktop.html#open%28java.io.File%29
    As per the requirement I should display the list of documents on the left panel. When the user selects a document from the list I should display the word or pdf document inline on the center panel of a border pane. However with no other alternative I have to convince the users to go with the above solution to open with the client installed application.
    >
    If this does not fit your needs, then explain why and provide more context, i.e. how many files, readonly or also editable, must the file be displayed as a JavaFX node, what will the user do with the file, are bitmapped images of the files sufficient, is the database on a server or also running on the JavaFX client . . .These files are to be strictly read-only. An external JSF 2.0 web based application uploads the files(PDF of Word) into the database. My javaFX application user should be able to read the content before accepting or rejecting the document. A bit-map image should be fine too as long as it is readable. Database is on a different server and my FX application communicates it through remote interfaces using EJB 3.1 deployed on glassfish.
    Thanks again.

  • Displaying PDF and Word Document

    Hi,
    I have used the methods to display HTML :
    1. Link to Action and the IFrame -> The Result was the html file I was able to display in the same window.
    2. Link to URL -> The Result was html file opened in different window.
    3.IFrame and attaching the file in project -> it was resulted in html file getting dispalyed in IFrame.
    Now if I want to extend the functionality for PDF or word document, is the procedure same or different
    Can anyone enlighten me on this
    Any thoughts on this.
    Thanks in Advance
    Srikant

    Hi srikant,
    You can also display word documents and pdf by uploading it in the server.
    For this you'll have to create  aliases in the server for the corressponding documents that you want to uploaad.
    Go to visual admin ->services->httpprovider.
    Then click the tab 'aliases'. Here you can give the name of your alias and also the document to which the alias should point(first upload the document to the server machine and then give the path here ) .
    Now when you type http://server:port/aliasname your document will open in the browser. You can display it either through your iFrame or linktourl as you prefer.
    Hope my effort will help you.
    Regards,
    Rahul.

  • Can I search for pdf and word documents at the same time in finder?

    I often want to search for more than one file type at a time - for instance pdfs and word docs in a directory, or Jpgs, GIFs, PNGs etc.
    Can I do this in the finder in one go (so I can save it as a folder I can then select when I want to)?
    I tried typing OR between the 'tokens' it creates, but then it just searches for OR - so not as intelligent as one would think?!
    Surely there must be a way to do something as simple as this?
    regards
    Rob

    Forget the whole "tokens" business (I think that is a pretty useless "improvement" to constructing Spotlight searches). Hit command-F to bring up the search window, and set your first criteria, in the example I changed it from the default Kind to Created Date, to keep the number of results manageable. Now hold down the Option key and click on the "+" at the end of the criteria line, it will change to "..." and you get a new criteria line. From the dropdown menu choose "Any" if necessary (this will give you the Boolean OR), then enter what you want in the first sub-head. To get a second sub-head OR criteria click the "+" at the end of the Any line.
    I don't generate many MS Word docs, so I just stopped in the example above after typing Microsoft, since that brought up all the MS anything I have from this year (a couple of Power Point thingies sent to me by friends).
    Francine

  • How can I transfer pdf and word document files from my computer to iphone 4?

    Hi,
    I have recently purchased an iphone 4,I need to know how to transfer my files from laptop to iphone, i have downloaded iTunes but can not add my iphone, basically I dont know if there is anything else i should do to be able to connect my laptop to iphone so that i can easily transfer files.
    Also,does any body know what application i can open my word documents with?
    and how easy it is to search through the file for a specific topic if its for example 1000 pages? how about in pdf files? how can i find a topic i need as fast as possible, say in an open book exam condition?!!
    thanks

    Try using the App PDF Reader Lite, I downloaded from the iTunes App store, it is free and works. Not only for PDF but Doc, page, etc.
    I Am using it and it is working oK

  • Darg a drop PDF a Word documents

    Need help. How can i Drag a drop PDF and  Word documents from webmail Accounts into a app to make Some notices there and send it per Mail. Now i have installed paperdesk.  iOS 501 ipadII.

    I'm not sure if this will work when reading mail ona  website, but in the mail client you can open the PDF, click on the box with arrow coming out of it icon in upper right, and select any PDF readers and editors you have on the iPad to open it.

  • Transfer pdf or word documents to ipad from macbook

    how can i transfer pdf and words documents of my iMac  to an ipad 2

    Many options, depending on what you want to do with them.
    mail them to yourself
    use iTunes
    use the desktop transfer programs that go along with Office Suite apps (i.e. Documents to Go, Quickoffice, etc)
    use Goodreader (a PDF/document reader as well as a file transfer and management app)
    use a cloud storage app (such as Dropbox or Sugarsync).
    If you want to edit the documents, you'll need an app that can do so. If you just want to read them, you have more options.

  • Is there a format for a file that I can use for attaching a one page document with photos embedded that will open in everyone's email automatically?   I've tried PDF and Word, but worked only in Mail.  Lost formatting when just copied and pasted in email.

    Is there a format for a file that I can use for attaching a one page document with photos embedded that will open in everyone's email automatically?   I've tried PDF and Word, but PDF worked only in Mail.  Word worked in nothing.  I also tried copying and pasting the document but lost all formatting when just copied and pasted in email.  Is there a way to do this?

    Are you sure PDF won't work? It should as what you're trying to do is pretty much what it is designed for (PDF - Portable Document Format). On a Mac anywone who receives the file should be able to see it in all its page layout glory by using the app Preview or Adobe Reader. Same on a PC, the file should be viewable as a PDF file using Adobe Reader and probably some other viewer (don't use PCs so not sure what other apps).
    What application are you creating the file in and are you sure you're exporting it correctly in PDF format, fonts and images embedded?

  • Hi how to protect form modification a shared scientific document in pdf and word format?

    hi how to protect from modification a shared scientific document in pdf and word format?

    For the PDF document: Use the tool panel on the right side and under the protection section choose the Restrict Editing option.  Set a password so that nobody can modify it.  In word

  • Why am I unable to convert my PDFs into Word Documents anymore?  I've had no problem until now and been signed up forever.  Please inform what the problem is???  TU!

    Please inform me why I am unable to convert my PDFs to Word Documents anymore.  I've been signed up and paid forever now and no problems until today,  Please inform me of what the problem is?  Thanks bunches!  :- @(

    Hi vtbabyof8,
    I just took a look at your account and see that it expired on June 14. I'll send you a private message with more information.
    Best,
    Sara

  • Write to word document from oracle plsql

    Hi,
    Please provide methods to create and write to a word document from ORACLE PLSQL.We tried using UTL FILE package but it writes as ascii text.

    Divs wrote:
    The server m/c operating system is unix.so we need to invoke the procedure from Unix Os.In that case - not possible. For Windows COM (Component Object Model) to work, Oracle database need to be able to call and load the COM dynamic link libraries.
    Not to say that it is not possible. Have never used DCOM (the Distributed COM interface), and not exactly sure what it requires. Assuming that DCOM is not usable from a Linux perspective, you can still provide a manual interface. You create a NT tcp/ip service that exposes the COM interface calls that you need - in a secure fashion (even better - you can provide a higher level abstraction layer for the COM interface that does the specific job you need to be done).
    From Oracle you can then use PL/SQL's UTL_TCP package to open a connection to it and via this service craft a Word document on that Windows server.
    Are there web services for MS Office? I know Google is pushing that aspect hard (and embroiled in lawsuits with the US government and Microsoft about tender awards in this aspect). Now if Microsoft has "+office-on-the-web+", then one can create a Word document via a web browser. This means that there is an underlying web service - and that this can be called and used. The Evolution (Open Source Mail Reader) project for example uses the MS Exchange web service interface to provide a seamless interface to Exchange mail accounts (have used this everyday for a number of years now).
    The real question I would however ask is why Word specifically? Why not a more common format like PDF? You can even consider generating XML instead. Both Microsoft and Open Office and others are supporting XML formatted word processing documents (as oppose to older proprietary and binary formats).
    And why not use a Report Writer? I'm a big fan of doing as much as possible in Oracle (using PL/SQL most of the time). But certain things, like generating Word-style documents would be better done (and more flexible too) using a Report Writer.

  • Displaying Word Document from a Database

    Let me try to explain this.
    I can upload and store a Word Document in an Oracle database
    (BLOB column) but now I need to extract that Word document and
    place a pointer to it on the Web. Can someone explain to me how
    this is done?
    I'm trying to do something like have an image displayed on
    the Web and when you click on it the Word Document is opened.
    Follow me on that? So, if there are 15 Word documents in the
    database, then the web page would have 15 images all pointing to
    each separate Word document.
    Has anyone done this?

    Don't take my word on this, but I think this should work;
    I've done this in the past to send dynamically-generated CSV files
    to the user, which is in a way (at least at the perspective of
    what's being outputted to the user) the same thing.
    First, obviously, you need to retrieve the Word document data
    from the database. We'll say you put that in a variable called
    'wordDoc'.
    <cfset wordDoc = someQuery.wordDataObj />
    Next, we need to set the 'Content-disposition' HTTP header,
    to tell the client's browser that we're sending a file, and that we
    want you to call it somefile.doc by default. We'll do this with the
    <cfheader> tag (note that if you use <cfflush> in the
    application, this tag (and thus, this approach)
    will not work.
    <cfheader name="Content-disposition" value="attachment;
    filename=somefile.doc" />
    Almost there. Now we need to set the Content-type HTTP
    header, to tell the browser what kind of data is coming, and then
    give it the actual file data. We'll use the <cfcontent> tag
    to do both of these things.
    <cfcontent type="application/msword"
    reset="yes">#wordDoc#</cfcontent><cfabort>
    If memory serves, this should be all you need. Note the
    <cfabort> after the closing <cfcontent> tag, I've had
    problems in the past with additional output on the page after these
    tags being appended to what gets sent to the browser, so I use a
    <cfabort> afterwards to make sure nothing more gets sent
    after the data we want. Also, at least with CFMX7, I've noticed
    that debugging output tends to get added in too regardless, so I
    typically put a <cfsetting showdebugoutput="false" /> at the
    top of the file, too.
    I can't guarantee this will work, I haven't tested this
    particular situation, but if it doesn't, it ought to be close. Let
    me know if I'm wrong.
    Attached is what should be the code without my commentary /
    rambling interspersed.

  • View PDF and Word file

    Post Author: vcharles
    CA Forum: Crystal Reports
    Hello,
    I am using crystal report XI with ACCESS 2003, I would like to create a field in my ACCESS table to insert the path of the PDF or word files I would like to view when I click on the report. Is there a way to do this? Whic is the best approach to view a PDF or Word document from the crytal report viewer?

    Post Author: pvierheilig
    CA Forum: Crystal Reports
    Just so I get the first part correct - this is what I understand you to want to do:Add column to Access db, say something like 'FILE_LINK'Have a field on your report that displays the value of the FILE_LINK data for either PDF or DOC's. To do this:Populate the Access db as you'd like, including the file extension.Add the database field to the report.Right-click the field and 'Format Field'.Select the 'A File' radio button.Select the Hyperlink tab.Select the 'X-2' button in the 'Hyperlink Information' area of that same tabbed window.Enter a formula for what you want to be shown.  To show 'somefilename.pdf' on a shared drive, for example, enter this formula:"
    x\" & {database.column}Click the 'X-2' icon with the green checkmark, near the top-left of the window.  Fix any errors reported.Click 'Save & Close' and then 'Ok' on the 'Format Editor' window.Drop/drag the field where you'd like it and you should be good to go. 

Maybe you are looking for

  • Anyone manage to install Windows 8 on new Macbook air?

    Hello, Got a new "June 2013" MacbookAir 13" 8GB 256SSD and I've been trying for days to install Windows 8 PRO 64-bit using Bootcamp. No joy. Tried both a USB key and an external DVD drive. Same problem all the time: in the Windows 8 setup, I selec th

  • Problem transforming some tiff into jpg

    Hi, my problem is I'm trying to convert a tiff image into jpg image, my code it's working for some files but not with all, i'm receiving a String represent the tiff file in hex base and transform into baytearray of jpg my code is the next if someone

  • Credit note report

    Hi, I am creating a report to monitor the volume of credit notes raised/issued and the areas these credit notes refer to so we can identify why we have so many credits and the reasons behind the credits. The report needs to show the following: Custom

  • Can not print mail document, 90 % just ******

    I try to print email but do not get complete print out. Header: very first line like from where email received. foot note- just ******** Body of the letter is also ***** some line prints. If I use Internet explorer , NO Problem

  • Pen Tool in PhotoShop CS3 VERY Slow

    I just installed CS3 on my laptop and am trying to use the pen tool to draw a path. I have to wait between 30 seconds and 2 minutes for each point to show up. Needless to say it's impossible to create a curve because I can't see the path. I'm using P