7 Replies Latest reply: Mar 27, 2014 6:57 PM by PRO Rachel RSS

    Adding attachments to an existing application

    PRO Rachel

      Hi,

       

      I'm building an application for check requests. After I had it mostly built, the users let me know they need to be able to attach files to the records as they create them, inserting the records into the table through an INSERT form. How do I build the functionality to add and store attachments?

       

      Happy to receive links to tutorials, instructions, or any good internet resource.

       

      Thanks,

      Rachel

        • 1. Re: Adding attachments to an existing application
          fac586

          Use declarative BLOB support to upload images to your table and display them in subsequent reports. See About BLOB Support in Forms and Reports in the documentation.

          There's also an OBE tutorial that followed the introduction of declarative BLOB support in 3.1 that is still relevant to 4.x.

          • 2. Re: Adding attachments to an existing application
            PRO Rachel

            Hi,

            I'm working on adding the attachment functionality. I added columns to my table:

            Column NameData Type
            ATTACHMENTBLOB
            ATTACH_MIMETYPEVARCHAR2(255)
            ATTACH_FILENAMEVARCHAR2(255)
            ATTACH_LAST_UPDATEDATE
            ATTACH_CHARSETVARCHAR2(128)

             

            I added a File Browse item to my Insert form with a storage type of BLOB column specified in Item Source attribute. Content disposition: Attachment.

            The Source section is source used: Always, Source Type: Database Column. Source Value or expression: ATTACHMENT. Format Mask: BLOB.

             

            When I run this page, I get the following error message:

             

            Error: No corresponding DML process found for page 2

            Contact your application administrator.

             

            http://proapex01.pro-unlimited.dev:8001/i/htmldb/builder/rollup_minus_dgray.gifTechnical Info (only visible for developers)

              • is_internal_error: true
              • apex_error_code: WWV_FLOW_NATIVE_ITEM.NO_DML_PROCESS_FOUND
              • component.type: APEX_APPLICATION_PAGE_ITEMS
              • component.id: 2330121538264620
              • component.name: P2_ATTACH
              • error_backtrace:

            ----- PL/SQL Call Stack -----

            object line object

            handle number name

            0xb41aec70 556 package body APEX_040200.WWV_FLOW_ERROR

            0xb41aec70 607 package body APEX_040200.WWV_FLOW_ERROR

            0xb41aec70 911 package body APEX_040200.WWV_FLOW_ERROR

            0xabff2288 3236 package body APEX_040200.WWV_FLOW_NATIVE_ITEM

            0xabff2288 3369 package body APEX_040200.WWV_FLOW_NATIVE_ITEM

            0xabff2288 4320 package body APEX_040200.WWV_FLOW_NATIVE_ITEM

            0xb41841a8 1251 package body APEX_040200.WWV_FLOW_PLUGIN

            0xabfcb788 999 package body APEX_040200.WWV_FLOW_FORMS

            0xabfcb788 1428 package body APEX_040200.WWV_FLOW_FORMS

            0xb4199e38 3772 package body APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS

            0xb4199e38 4605 package body APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS

            0xb4199e38 3264 package body APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS

            0xb4229030 1788 package body APEX_040200.WWV_FLOW_PAGE

            0xb4229030 1958 package body APEX_040200.WWV_FLOW_PAGE

            0xbe5a57c0 5614 package body APEX_040200.WWV_FLOW

            0xb424a640 249 procedure APEX_040200.F

            0xa1c47258 30 anonymous block

             

            So, what do I need to do to resolve this DML process issue?

             

            Thanks so much for your help.

            • 3. Re: Adding attachments to an existing application
              PRO Rachel

              Looks like I may have this working on my Insert page. I changed the setting to No and I'm not getting the error. On to the report and edit pages now.

              • 4. Re: Adding attachments to an existing application
                fac586

                The form page must have an Automated Row Fetch (ARF) process based on the table containing the BLOB—even if the form items are populated using another method. If you don't load the form data via ARF, create an ARF process and disable it by setting its Condition type to Never. (Yes, this is weird, but it somehow keeps the APEX internals happy.)

                • 5. Re: Adding attachments to an existing application
                  PRO Rachel

                  I have not done the ARF yet. I'm getting the error message below when I try to view the report page.

                   

                  ORA-06502: PL/SQL: numeric or value error: character to number conversion error

                   

                  Is it something with the Attachment column? Is there additional information I should provide to help you help me?

                  • 6. Re: Adding attachments to an existing application
                    PRO Rachel

                    I was messing around and I found that by clearing out my Number/Date Format field, the error above (ORA-06502: PL/SQL: numeric or value error: character to number conversion error) no longer occurred when viewing the report page. This is what was in the Number/Date Format field:

                         DOWNLOAD:MANUAL_CHECK_LOG:ATTACHMENT:ID::::::Attachment:Download

                     

                    To get there, I set the Number/Date Format field to BLOB, which opened up the Blob Column Attributes section, which I populated as follows:

                         Format Mask: DOWNLOAD

                         Table: MANUAL_CHECK_LOG (my table name)

                         Column: ATTACHMENT

                         Primary Key Column 1: ID

                         Content Disposition: Attachment

                         Download Text: Download

                     

                    What's the right way to set the Attributes so I don't get the number conversion error? What am I doing wrong?

                     

                    Then I can create the ARF. Is it correct that I should create the ARF on my Insert Page, in the Page Processing section, under Processing?

                     

                    Thanks again for the help. Have I mentioned yet that I'm very grateful for the assistance?

                    • 7. Re: Adding attachments to an existing application
                      PRO Rachel

                      Also, when I finally get this working, I'll want the attachment name to be visible in the Update page and I'll want the computer to automatically detect the file type and open the appropriate program. Is this a MIME_TYPE setting? How do I configure this in APEX?