Storing MS-Word and PDF documents in database uploaded through APEX

I want to allow users to upload MS-Word and PDF documents they have created / edited outside of the APEX app for storage in the database along with the other app data.
I know that I should use a file browse item in a region for this purpose.
I have a some questions:
1. What database datatype is best for storing MS-Word and PDF docs? CLOB?
2. How can the user see that the file has been uploaded? In other words, how can they see that the filename has been uploaded? I want to show this on the page for later viewing. I have uploaded a document, but later, I have no way to see that the document has in fact been uploaded. From the APEX page, the file browse item does not indicate whether or not a file has previously been uploaded.
3. How can the user download the previously uploaded document?
4. Is there a way to give users the capability to edit a document in an APEX app where they can do MS-Word-like editing (font size, font type, bold, italics, etc.)?
I know I've asked a lot here and I appreciate your input.
-Reid

In my case, I am uploading screenshots of my application and then displaying them. You can feel free to use it if you want, the code was mostly taken from examples of file uploads posted by others. Here is some code to get you started:
File Table description
CREATE TABLE FILE_UPLOAD
   (name           VARCHAR2(4000) PRIMARY KEY,
    subject        VARCHAR2(4000),
    id             NUMBER,
    blob_content   BLOB,
    mime_type      VARCHAR2(4000),
    PAGE_ID        NUMBER);File Upload Procedure
IF ( :P20_FILE_NAME is not null ) THEN
     INSERT INTO FILE_UPLOAD (id, NAME, SUBJECT, BLOB_CONTENT, MIME_TYPE, PAGE_ID)
      SELECT ID,:P20_FILE_NAME,:P20_SUBJECT, blob_content, mime_type, :P20_PAGE_ID
            FROM APEX_APPLICATION_FILES
            WHERE name = :P20_FILE_NAME;
   DELETE from APEX_APPLICATION_FILES WHERE name = :P20_FILE_NAME;
  END IF;Download Image Procedure Definition
CREATE OR REPLACE PROCEDURE download_my_file(p_file in number) AS
        v_mime  VARCHAR2(48);
        v_length  NUMBER;
        v_file_name VARCHAR2(2000);
        Lob_loc  BLOB;
BEGIN
  SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
         INTO v_mime,lob_loc,v_file_name,v_length
    FROM FILE_UPLOAD
   WHERE id = p_file;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
  owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
  htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
  htp.p('Content-Disposition:  attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers           
  owa_util.http_header_close;
    -- download the BLOB
  wpg_docload.download_file( Lob_loc );
end download_my_file;
/make sure to grant the procedure rights for use by anyone
GRANT EXECUTE ON download_my_file TO PUBLICDisplay Image Procedure Definition
create or replace PROCEDURE "DISPLAY_IMAGE"
  inID NUMBER
AS
  vMIME VARCHAR2(48);
  vLENGTH NUMBER;
  vFILENAME VARCHAR2(2000);
  vBLOB BLOB;
BEGIN
  SELECT MIME_TYPE, BLOB_CONTENT, NAME, DBMS_LOB.GETLENGTH(BLOB_CONTENT)
    INTO vMIME, vBLOB, vFILENAME, vLENGTH
  FROM FILE_UPLOAD
  WHERE ID = inID;
  owa_util.mime_header(nvl(vMIME, 'application/octet'), FALSE);
  htp.p('Content-length: ' || vLENGTH);
  owa_util.http_header_close;
  wpg_docload.download_file(vBLOB);
END;
/Again, make sure everyone has rights to execute the procedure.
GRANT EXECUTE ON DISPLAY_IMAGE TO PUBLICThis doesn't create an editor inside the browser, it just creates a simple upload/display process. For a WYSIWYG editor that handles PDF or Docs, you'll need something far more sophisticated, and I can't suggest anything there.

Similar Messages

  • Best solutions for storing text, Word and pdf documents on iPad

    I just switched from using a powerbook to an iPad + microkeyboard for my work computer (I'm freelance and need to bring my own device wherever I go), and I love the size and weight of it compared to a laptop.
    What I am glitching on is the fact that I cannot save documents to my ipad. Clients email Word and PDF docs to me, and I have (very few of) my own docs, such as resumes, which I need to update slightly and send out to them as well. It's not ideal when I need to send out a resume to dig through my Sent folder on Mail and forward it, creating a new email but just saving the attachment. I also need to access certain received documents repeatedly as reference. I'm surprised iOS for iPad doesn't have a "Documents" folder as OS X does.
    How are users working around this problem currently? Please give me suggestions for solutions. I'm hopeful that future iterations of iOS will provide a way to store and access a personal library of documents as it does photos and videos, so I will commit to working through this in the short term. What are your work arounds?
    T

    I doubt iOS will ever change. iOS does not have a file manager system like you're used to on a laptop or desktop, so it lacks the ability to access files like you're used to. So whatever workarounds you find will likely become your regular work flow. If Apple hasn't added a file manager to iOS in the past 5 (give or take) years it's doubtful they'll do so in the future...the lack of a file manager is why the iOS operating system is so secure, viruses can't infect and use a file manager system to spread if they don't have one.)
    iOS ties the access to files to the apps that access them. As you said, photos with the photos app, music with the music app. With your purchase of a new iOS device you are eligible for free Apple apps, amongst them Pages and Numbers, Apple's word processing and version of excel.. You can store your documents in that app and access them that way. Or there are tons of other word processing apps. I use Documents to Go (although it's not free so you may wish to  experiment with the free apps first before  you start paying)
    File transfer....well Apple's work flow is that everyone has access to always on and always available internet, thus their workflow being built around the cloud and using the internet for file transfer, as well as e-mailing stuff to yourself. There are some flash drives out there that have their own wifi transmitter that may help you. You'd plug them into another computer, put the file on it, turn on the wifi transmitter and use a small localized hotspot to connect your ipad to and download the files to your iPad via an app that will come with the flash drive.

  • Generating word and PDF documents

    How can I generate Word and pdf documents with JDeveloper ?
    Iwan

    You already got answers on your previous thread:
    Create *.doc and *.pdf files with jDeveloper

  • Converting Robohelp Content to a Word and PDF document.

    I am in the process of creating an online help manual with several jpg images.  The jpg images are clear in Robohelp, but when I convert the content to a Word or PDF, the content and images are fuzzy and blurry, especially the PDF. Any thoughts or suggestions as to why this is occurring?  I did not have this issue with my last project, the clarity, content, and formatting was very clear including the jpg images.
    Thanks,
    Wendy

    Hi Wendy,
                there is almost no conversion of images on generating any output from RoboHelp, can you please also specify how those topics with images were created.
    if possible please share a sample image and correponding code snippet from RoboHelp.
    you can try removing any resizing done to those images and then generate the output.
    Ashish

  • Urgent Help Regarding Storing Word and PFD Documents

    Dear Friends
    I want to store my word and pdf documents in my database using 8.1.7 for windows NT. It is quiet urgent so if any one of u guys could help me step by step . How to insert and retrieve my doc and pdf files in and from database.
    I'll be highly thankful to you.
    Regards

    The DBMS_LOB package does not support writing of data from BLOBS to the filesystem.
    An export method is defined for the intermedia doc type.
    NOTE: look at the notes and make sure the correct permissions are granted to the user for this method to work. This is in the 8.1.7 documentation which is not on OTN at this time...
    However, the intermedia does have an export method that was implemented as a java stored procedure.
    http://otn.oracle.com/doc/oracle8i_816/inter.816/relational_interface/mm_relat.htm#1078905
    You can write your own java stored procedure to write the file, place the document in an intermedia doc type and use the export method, or use the relational interface export() function.

  • Saving a WORD or PDF document in the database?

    Hello,
    If I have a WORD document, PDF document or EXCEL document. How can I save them in the database? What type of LOB I should use.
    What I would like to do is have a webpage with a text box and a browse button. The user can then use the browse buttton to find the file and have its location inserted into the text box. Then the user can click another button to add the file to the database.
    Once the file is in the database - I also want to have an update page where the user can change the files saved in the database or delete them also
    Thanks
    Doug

    Well, Word and Excel documents are binary, so you will need a Binary LOB (BLOB).
    I have recently been storing/retrieving BLOBs through ASP/ADO . . .
    BLOBs are limited to 4GB, but ADO has a limit of 2GB. Hopefully, that will not be a problem.
    If you are using ODBC, then be aware that you need to enable LOBs by setting LOB=T in the connection string. If you are using ODBC with stored procedures, then there is a bug that causes the LOBs to be truncated to 32K, which is fixed in 9.2.0.6.5. A colleague tells me that the Microsoft ODBC Driver for Oracle works with LONGs but not with LOBs.
    If you are using OleDB with stored procedures, then you'll need to set the "SPPrmsLOB" property to TRUE.
    When uploading BLOBs through ADO, you need to set the parameter size to 1 higher than the actual size, otherwise you get an error.
    When retrieving the BLOBs through stored procedures as OUT parameters, you need to set the parameter size to larger than the BLOB, otherwise it gets truncated. I do not like having to specify 2GB for a file that might only be 32K, so I prefer to return a record set via a REF CURSOR.
    Tak

  • Using Oracle Text to search through WORD, EXCEL and PDF documents

    Hello again,
    What I would like to know is if I have a WORD or PDF document stored in a table. Is it possible to use Oracle Text to search through the actual WORD or PDF document?
    Thanks
    Doug

    Yes you can do context sensitive searches on both PDF and Word docs. With the PDF you need to make sure they are text and not images. Some scanners will create PDFs that are nothing more than images of document.
    Below is code sample that I made some time back to demonstrate the searching capabilities of Oracle Text. Note that the example makes use of the inso_filter that is no longer shipped with Oracle begging with Patch set 10.1.0.4. See metalink note 298017.1 for the changes. See the following link for more information on developing with Oracle Text.
    http://download-west.oracle.com/docs/cd/B14117_01/text.101/b10729/toc.htm
    begin example.
    -- The following needs to be executed
    -- as sys.
    DROP DIRECTORY docs_dir;
    CREATE OR REPLACE DIRECTORY docs_dir
    AS 'C:\sql\oracle_text\documents';
    GRANT READ ON DIRECTORY docs_dir TO text;
    -- End sys ran SQL
    DROP TABLE db_docs CASCADE CONSTRAINTS PURGE;
    CREATE TABLE db_docs (
    id NUMBER,
    format VARCHAR2(10),
    location VARCHAR2(50),
    document BLOB,
    CONSTRAINT i_db_docs_p PRIMARY KEY(id)
    -- Several notes need to be made about this anonymous block.
    -- First the 'DOCS_DIR' parameter is a directory object name.
    -- This directory object name must be in upper case.
    DECLARE
    f_lob BFILE;
    b_lob BLOB;
    document_name VARCHAR2(50);
    BEGIN
    document_name := 'externaltables.doc';
    INSERT INTO db_docs
    VALUES (1, 'binary', 'C:\sql\oracle_text\documents\externaltables.doc', empty_blob())
    RETURN document INTO b_lob;
    f_lob := BFILENAME('DOCS_DIR', document_name);
    DBMS_LOB.FILEOPEN(f_lob, DBMS_LOB.FILE_READONLY);
    DBMS_LOB.LOADFROMFILE(b_lob, f_lob, DBMS_LOB.GETLENGTH(f_lob));
    DBMS_LOB.FILECLOSE(f_lob);
    COMMIT;
    END;
    -- build the index
    -- Note that this index differs than the file system stored file
    -- in that paramter datastore is ctxsys.defautl_datastore and not
    -- ctxsys.file_datastore. FILE_DATASTORE is for documents that
    -- exist on the file system. DEFAULT_DATASTORE is for documents
    -- that are stored in the column.
    create index db_docs_ctx on db_docs(document)
    indextype is ctxsys.context
    parameters (
    'datastore ctxsys.default_datastore
    filter ctxsys.inso_filter
    format column format');
    --search for something that is known to not be in the document.
    SELECT SCORE(1), id, location
    FROM db_docs
    WHERE CONTAINS(document, 'Jenkinson', 1) > 0;
    --search for something that is known to be in the document.  
    SELECT SCORE(1), id, location
    FROM db_docs
    WHERE CONTAINS(document, 'Albright', 1) > 0;

  • I am having the same problem I think.  With mobileme you simply copy documents to the idisk folder and then synch.  I cannot seem to sink that folder anymore.  Any idea as to how I can simply copy folders to icloud and then access the MS Word and PDF file

    I am having the same problem I think.  With mobileme you simply copy documents to the idisk folder and then synch.  I cannot seem to sink that folder anymore.  Any idea as to how I can simply copy folders to icloud and then access the MS Word and PDF files on my iphone?

    Apple never bopthered to explain that this would happen
    Your iDisk is still accessible after moving to iCloud in exactly the same way as before. Nothing is deleted until June 30th 2012.
    , so I could easily have lost ALL of the files I kept on iDisk.
    No, you couldn't. Firstly, nothing was deleted from your iDisk. Secondly, any files stored on your iDisk should never be your only copy. Even if your iDisk spontaneously combusted, you should keep local backups elsewhere.
    Does Apple WANT people to move their storage elsewhere and stop paying Apple for it?
    Yes. Apple doesn't provide such a service anymore, nor are you paying them for it.
    Apple has made no effort to suggest remedies for the problem it has given iDisk users
    They've provided instructions on how to download your files from your iDisk. What you do with them after that is your choice.

  • Will I be able to create fillable pdf forms from existing word and excel documents?

    Will I be able to create fillable pdf forms from existing word and excel documents?

    Hi
    Yes you can. You may visit this link to check the workflow: https://www.youtube.com/watch?v=O0PPzFq3X00
    Regards,
    Ajlan Huda.

  • Why is my word and pdf files so large? How can I reduce the size?

    My document contains mostly photos from a database via a path to the actual jpeg photos on disk.
    There are 39 jpeg photos + a small amount of text with each photo.
    The 39 jpeg photos on the disk add up to be 5.79 mb.
    If I export the crystal reports document as [Microsoft Word (97-2003) Non Editable] the, the file size is 36.8 mb.
    If I export the same data as a [Microsoft Word (97-2003) Editable] the file size is only 3.1 mb.
    That is a difference of 33.7 mb! Why?
    Also, when I export the same data to a PDF file it is much larger than I think it should be; 12.7 mb.
    Why is my word and PDF files so large?
    How can I reduce the size of the word and PDF files? (without reducing the photo quality).
    Are there any tools to post process the Word or PDF files to reduce the file size?

    You can't, extra size is to hold the details

  • Component to URL link a word/excel/pdf document inside Page

    Hello Experts,
    I would really appreciate if somebody can answer if there are any standard component or functionality available to call a network URL link to a word/excel/pdf document inside a ABOUT tab page for the definition and screenshot of How-to and functionality of the dashboard.
    I am trying to avoid creating a custom component to use SAP UI5 HTML control to initialize a OLE object call to a given URL.
    Thanks
    Arun

    Well, Word and Excel documents are binary, so you will need a Binary LOB (BLOB).
    I have recently been storing/retrieving BLOBs through ASP/ADO . . .
    BLOBs are limited to 4GB, but ADO has a limit of 2GB. Hopefully, that will not be a problem.
    If you are using ODBC, then be aware that you need to enable LOBs by setting LOB=T in the connection string. If you are using ODBC with stored procedures, then there is a bug that causes the LOBs to be truncated to 32K, which is fixed in 9.2.0.6.5. A colleague tells me that the Microsoft ODBC Driver for Oracle works with LONGs but not with LOBs.
    If you are using OleDB with stored procedures, then you'll need to set the "SPPrmsLOB" property to TRUE.
    When uploading BLOBs through ADO, you need to set the parameter size to 1 higher than the actual size, otherwise you get an error.
    When retrieving the BLOBs through stored procedures as OUT parameters, you need to set the parameter size to larger than the BLOB, otherwise it gets truncated. I do not like having to specify 2GB for a file that might only be 32K, so I prefer to return a record set via a REF CURSOR.
    Tak

  • Word and Pdf files with Forms

    Hi,
    I want to store *.doc and pdf files in database and use them in forms 9i .
    My customer wants to open,edit and save the files from the database through forms 9i application.
    Can anyone please help me in process of storing the files into database and access them from forms 9i .
    Thanks
    Sai

    Hello,
    <p>Here is one solution.</p>
    Francois

  • Send word or pdf document as HTML email

    Hello all,
    we have word documents (on a local file) that we want to send via SAP as HTML email, i.e. we need the content of the word document in the email body. The documents also contain images. With the class cl_bcs I can send mails including attachments and also pure HTML but I don't know how to convert the word or pdf document into HTML and how to process it to get the images in the correct way. Is there perhaps a more direct way to achieve the goal to mail the word documents? Is there anybody who can help?
    Thank you very much and best regards
    Frank

    First, as you guessed, most (all?) mail clients don't display "complex" documents (doc, xls, pdf, etc.) inside a mail, they are always provided as attachments. Only simple documents like images can be directly displayed.
    SAP's job is not to convert from a format to another, especially .DOC and .PDF formats, which are rather complex.
    You'd better look at specialized third-party softwares. Note that SAP has a connection tool called BC-XDC (eXternal Document Converter) which is used to connect these third-party softwares to SAP. You may look at the certified softwares using this connection tool.
    Notes: if the .DOC and .PDF documents are generated by one of your programs, prefer to modify them to generate the documents in another format (HTML) instead of converting them. I can't say much as I don't know your exact scenario.
    There is also SO_RTF_TO_HTM (and CONVERT_TEXT maybe) function module, but I wouldn't expect much of it.

  • Create Microsoft Word or PDF document in WebDynpro

    Hi,
    I need to create either a WORD or PDF document in WebDynpro. Can someone provide some information regardign this.
    Ravi ...

    Hi Ravi,
    why haven't you marked this question as a question? There's a checkbox for that.
    Please note that there's a Web Dynpro forum for questions about Web Dynpro: Web Dynpro Java
    Do you use Web Dynpro ABAP or Java?
    For WD4A the information about PDF is here:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/241a427ff6db2ce10000000a1550b0/frameset.htm
    And for Word documents you can use the UI element OfficeControl:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/af8841349e1909e10000000a155106/frameset.htm
    Regards, Heidi

  • OWA - "Sorry, we ran into a problem" when openingen word and pdfs

    Hi,
    I have a weird problem similar to
    this one where office web apps will not open my word and pdfs on my SharePoint server. Other documents like excel and powerpoint are working just fine. I'm running SP1+ on both SP2013 and OWA server.
    When I open a word or pdf document it opens my document in view mode and displays this error aswell:
    It works fine in other browser such as Google Chrome and also if I change emulation mode to IE9.
    If I check the debugging of the site I get this error:
    Object doesn't support property or method 'selectSingleNode'
    My site is added to the local intranet zone.
    The problem is only located on our a new Citrix farm. If I compare the IE security settings and the local Intranet zone with my own client that also runs IE11 the settings are the same. However it works fine on my own machine. IF I choose to Reset my Internet
    Explorer settings it works also until I log off Citrix completely and back on.
    Any idea on what settings causes this behavior?
    Thanks

    Check if your IE Is 32 bit or 64 bit.
    Also check Office installed on system is 32 bit or 64 bit
    do all users face same issue
    did you added both OWA and SharePoint URL in trusted site
    https://social.technet.microsoft.com/Forums/en-US/591cdbc6-a4a9-4f0c-b242-6fc2c04a6149/ie-11-and-sharepoint-2013-word-web-app?forum=sharepointadminprevious
    http://sharepoint.stackexchange.com/questions/95617/office-web-apps-broken-in-ie11
    upgrading my OWApps to the latest December CU seems to have fixed my problems with IE11.
    If this helped you resolve your issue, please mark it Answered. You can reach me through http://itfreesupport.com/

Maybe you are looking for

  • 7.6.2-burned mp3 CDs won't play in players that 7.5-burned versions did

    I have discovered yet another beef with iTunes 7.6.2... does anyone else have this problem? mp3 CDs burned in iTunes 7.6.2 on my Intel iMac will not play in my car player, while identical mp3 CDs burned in itunes 7.5x on my iBook G4 WILL play in my c

  • Csv display

    I have a corporate reports web site that includes links to CSV files.   Using Snow Leopard and Safari 5.1.1 (all software up to date) the file would display in the browser, the same as PDF files on the same reports web site.    However under Lion 10.

  • Missing letters

    All of a sudden when I turn on my computer in the am, my file name and drop down menus are missing letters. Like if the file name was "energyFile.doc", if might show up as " ne gyF e.d " Same with my drop down menus. I have run TechTool Pro on it - B

  • Components inside components - Bad design?

    Is it bad practice/design to nest components inside components using Flex 4? Should I simply be creating components and inserting them into my main application as below, or doesn't it matter? <com:MyComp1>     <com:MyComp2>        <com:MyComp3>      

  • HELP needed for integratio​n

    NTEGRATIO N HELP Options 06-24-2010 02:52 AM Hi all, Im new to labview and am not sure how to perform the correct integration of a signal. The problem i have is that after integration the signal is offset by a value. I know this is due to the antider