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.

Similar Messages

  • How to display word document as a HTML document in portal

    Hi
    I developed a portal application in that i am displaying word document using IFrames, from my application i am uploading word document and saving those document in KM
    Requirement is that i need to provide an option to show this word document in html.
    Thanks
    Rudradev.

    Hi Glenn Mendonca
    I thing it is possible
    Even in SDN search results page, we have option called "HTML version" link
    to see the search document in HTML
    see the below url
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2fforums%2fsdn_forums%2fthread%7b74687265616449443d39313633%7d.jspa
    i hope passing doucment as a query parameter to com.sap.km.cm.highlightedcontent?DocumentUri=
    might solve this
    pls give your inputs
    Thanks

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

  • Office Control does not display word document

    HI all,
    I followed the example code to display a word document in the office Control UI, but the display remains blank when I push the button to 'show document'.
    I do not have MS Office installed on the server so I have a wordpad named example.doc on the C drive. Can I read the data from wordpad and display it on the Office Control?
    Thanks
    Jay.

    > Thanks all,
    > I have Office 2003 installed on the client but not on
    > the server. The bytes[] array gets loaded with the
    > string '[B@10e770f', but the display stays empty.
    >
    > Jay
    Hi Jay,
    I need to use this feature as well. Did you get it to work. Can you display and edit a Microsoft Word document from within a browser page. It would be good to know that you have been successful.
    Jesse

  • Displaying Word documents on web using IFS

    I am trying to display word documents stored in IFS on the web using the IFS Java API. The process we are currently using is outlined as follows :
    1. Connect to IFS using the connect() method of LibraryService class.
    2. Obtain references to IfsFileSystem object and PublicObject (using findPublicObjectbyPath() method of IfFileSystem class).
    3. Cast the PublicObject to Document class.
    4. Obtain a reference to the InputStream using the getContentStream() method of Document class.
    Now, how do we display the contents of this document on the web ? Is there any IFS classes that do this for us or do we have to rely on the Java I/O classes to read the InputStream char-by-char and display the file ?
    Thanks

    If you are trying to retrieve binary content through a customer Web client, you wouldn't write it to the browser - since the browser can only display HTML.
    Instead, you would generate a Web page which includes a URL to the document (e.g. http://ifsserver/:81466, or http://ifsserver/public/mydoc.doc). Subsequently, when a user clicks the URL, the browser will request the document directly from Oracle iFS' http server. When the http protocol server returns the document content, the browser will determine its MIME type, and launch the appropriate viewing application or helper application automatically.
    null

  • How to create a SSIS package to delete word documents from local system

    Hi All,
    How to create a small SSIS package to delete word documents from local system. Word documents might be one or two weeks ago.
    Thanks in advance for your help.

        Dim filename As System.IO.FileSystemInfo
            filename = My.Computer.FileSystem.GetFileInfo("c:\temp.doc")
            If (Now.DayOfYear - filename.CreationTime.DayOfYear) > 3 Then
                'filename.Delete()
            End If
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • HP Laserjet PRO MFP125nw doesn't print Microsoft Word documents from PC

    Hello.
    I've recently bought a brand new HP Laserjet PRO MFP125nw printer. The functions seemed really nice and the price was acceptable. I've brought it to my home, installed it following the manual, connected it to Wi-Fi etc. It generally works fairly well. PDF files are printed perfectly well, the scaning function works and it's generally a nice piece of technology.
    The only problem is that it just doesn't want to pring Microsoft Word documents from my PC. It prints it perfectly when I try to print .docx from my smartphone using the app, but it doesn't respond when I try doing it from the PC.
    My Office version is 2007 Enterprise. Do you have any idea what I should do?
    Thank you in advance

    Thank you a lot for a quick reply, Cbert. It's fantastic to see HP actually reading their forums and trying to help!
    I'll try plugging it into the wall and directly to the PC with a USB, we'll see if it works out.
    About Word, i've already tried reinstalling Word, even installed a 2003 version to check if it works with that. Well it doesn't. And as i've written before, I tried turning some .docx files to .pdf using a converter, but it still doesn't print them.
    Anyway, i'll try the first two points and keep you updated, thanks!

  • Open a word document from a Java Application

    Hi,
    Can I open a word document from a java GUI apllication and point to a bokkmark automatically in the word document when opened.

    See this thread:
    http://forum.java.sun.com/thread.jspa?threadID=228332&messageID=810684

  • Calling Word document from Oracle Forms 10g

    Hi all,
    I would like to call a Microsoft Word document from my Oracle Forms 10g.
    What would be the best way to do this?
    Thank you in advance.

    Have you tried something like
    WEB.SHOW_DOCUMENT('file:///<documentpath>','_blank');

  • I am getting an unknown error when trying to download a word document from mail to pages, any help

    I am trying to download a word document from mail into pages and I keep getting an unknown error message, are there special settings for this? Any help much appreciated!

    Not there aren't any special settings for this. You just use the Open In feature to save the document into Pages. You could have a font in the document that Pages doesn't like, maybe something that you copied and pasted from somewhere into the document that went corrupt. But there is nothing special about the way that you save a Word document into Pages. You save it like you save any document or file into a compatible app.

  • When I try to install abode - it will download but says i have to close firefox before it will install. also i try to open a word document from a website and it will not open - it will only download

    i install abode - it will download but not install and indicates i have to close firefox before it will download. Also, I try to open a word document from a website - it will download but not open.

    You need to close Firefox to install many plugins, including those from Adobe.
    As for the Word downloads, see the changing downloads action section of this link - https://support.mozilla.com/kb/Managing+file+types

  • 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

  • Upload / Open a Word Document from BDS with WebDynpro

    Hello,
    we use the BDS (Business Document Server) to storage our word files. Now we use WebDynpro with the UI OfficeControl.
    Could any one tell me, how to open/upload my documents from BDS with the OfficeControl.
    The UI FileUpload does not work, because it is not allowed to use specify URLs. link:[http://help.sap.com/saphelp_nw70/helpdata/EN/b3/be7941601b1d09e10000000a155106/frameset.htm]
    For example that is the URL from the BDS: "SAPR3://SAPR3CMS/get/100/BDS_5FDB2_5FR/7B3AAF5B22AAD21197ED0060B0672A3C/Forminterface.doc"
    I use the class "CL_BDS_DOCUMENT_SET" with the method "get_with_url". result is above.
    Each example with the OfficeControl from SAP (Package SIOS) use the Mime Repository:
    mime_repository = cl_mime_repository_api=>get_api( ).
      CALL METHOD mime_repository->get
        EXPORTING
          i_url     = url
        IMPORTING
          e_content = content.
      wd_context->set_attribute( name = 'DATAS' value = content ).
    Have any one an idea, how BDS and WebDynpro works together

    What about getting the binary of the word document from BDS and download this?
    Yes, it exist a method calls "get_with_table". This return the binary path from my url above.
    Here is my source code:
    public attributes
    DATA oi_document TYPE REF TO if_ios_wordprocessing.
    DATA oi_factory TYPE REF TO if_ios_factory.
    METHOD wddomodifyview .
    DATA ol_node TYPE REF TO if_wd_context_node.
    DATA ol_office TYPE REF TO cl_wd_office_control.
    DATA vl_document TYPE xstring.
    short from
      vl_document = myBDS->get_with_table( ).
    Settings for UI OFFICE_CONTROL
      ol_node = wd_context->get_child_node( 'OFFICE' ).
      ol_node->set_attribute( name = 'DATASET' value = vl_document ).
    get the office control
      wd_this->oi_office ?= view->get_element( 'OFFICE_CONTROL' ).
    get the IOS Factory
          wd_this->oi_factory ?= ol_office->_method_handler.
    get proxy document
          wd_this->oi_factory->get_wordprocessing_proxy(
          IMPORTING proxy = wd_this->oi_document  ).
    CALL METHOD wd_this->oi_document->if_ios_document~opendocument( ).
    ENDMETHOD.
    When I compile everything is ok. But when I run my application, it nothing happen. No word file is opening or no error message. I create a ALC trace (SAPNOTE 949770).
    Each time when I try to open my word file comes a popup-window from the alc-trace:
    ERRO|20081024143529|WD86_1300|CIOS_GeneralDocumentContainer_Acf::| STG_E_READFAULT  : readaccess|HRESULT=-2147287010(     A disk error occurred during a read operation)
    ERRO|20081024143529|WD86_1300|CIOS_GeneralDocumentContainer_Acf::|Office version is lower than 12, only native office format supported|HRESULT=-2147467259(Unspecified error
    ERRO|20081024143529|WD86_1300|CIOS_GeneralDocumentContainer_Acf::|loadOffice2007xml|HRESULT=-2147467259(Unspecified error )
    But I have access to the BDS and to the document.
    Can any one help me.....
    Regards
    Nils

  • Display Word Document as read only in VI pannel

    In a VI pannel I put an Active X container with the IE browser to display Word documents.
    The document are displayed properly but I want not give the user the possibility to make changes while viewing.
    Is there a solution to do so?
    (The documents are read-only and can not be saved.)

    Why use an IE container to display Word documents? You can place a word document directly in the ActiveX container. This seems a better choice.
    If you wish to totally block user-input, you can place a transparent picture control over the display of the Word document.
    Another alternative would be to convert the word document to a PDF and show this in an AcviteX container.
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Word-documents from email

    Which app should i use if i want to open and print Word-documents from my email on ipad?

    Documents to Go and Pages are two options and there are others. Just search the app store for word processors. Some are free, others not.

Maybe you are looking for