5 Replies Latest reply: Aug 11, 2014 12:54 PM by PRO Rachel RSS

    How to create blob to upload and download

    jerry44

      Hi, I've beed searching for solution of this problem and i found on http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/advnc_blob.htm that i'll need to  add following collumns:

       

         (ATTACH_MIMETYPE     VARCHAR2(255),

          ATTACH_FILENAME     VARCHAR2(255),

          ATTACH_LAST_UPDATE  DATE,

          ATTACH_CHARSET      VARCHAR2(128));

         

      Do I have to add all of them to the table i want to flies blob in, or maybe part of them will be mandatory? How to properely add to existing form item for uploading file?

       

      I do not understand section "Providing a Download Link" Could anybody tell me how to create download link with filename (and date of upload if possbile)?

        • 1. Re: How to create blob to upload and download
          TexasApexDeveloper

          Yes, you will need to add those columns so that your form can properly upload a blob to your data table.  They are ALL used to coordinate the upload process from your user's workstation.

           

          Re: Download link..You would build a report region and in your query include a column for the download link to be displayed based upon the blob size.

           

          If you post an example up on Oracle's hosted site, people can help you better..

           

          Thank you,

           

          Tony Miller
          LuvMuffin Software
          Ruckersville, VA

          • 2. Re: How to create blob to upload and download
            jerry44

            If you post an example up on Oracle's hosted site, people can help you better..

            TexasApexDeveloper napisał(-a):

             

            If you post an example up on Oracle's hosted site, people can help you better..

             

            Tell me more about that. I just need to upload in form and download in repport.

            • 3. Re: How to create blob to upload and download
              TexasApexDeveloper

              About what? Posting an example up on apex.oracle.com?

               

              You create an account and workspace, then upload your application (what you have of one so far) and post the login information in this thread, and probably someone here will show you how to do the coding from the example you have quoted..

               

              Thank you,

               

              Tony Miller
              LuvMuffin Software
              Ruckersville, VA

              • 5. Re: How to create blob to upload and download
                PRO Rachel

                Jerry44,

                I've been working on this and I just got it to work. You need to add all 4 columns to the table and to the insert and update forms but you can hide the fields (display as hidden) so no one has to touch them. They just need to be there. You also need to add a column for your attachment (Blob file). On your insert form, this will be a File Browse Item. When you are setting up this column, you need to include all the other columns in the set up in the Item Source attribute section. You will also need to do this in the Blob column attributes section of your report set up. Then, in the SQL code for the Regions source (on the report) you need to make some changes. Mine looked like this:

                 

                SELECT ID1,

                  FILE_NICKNAME,

                  FILE_DESCRIPTION,

                  MIME_TYPE, 

                CHARACTER_SET, 

                DBMS_LOB.GETLENGTH(ATTACHMENT) ATTACHMENT, 

                  CHANGE_DATE 

                FROM TEST_FILE_ATTACH_2

                 

                Each of those lines corresponds to one of the columns and the DBMS line is for the attachment. My column is (very creatively) named "ATTACHMENT" so that is what is listed in this line of code.

                 

                I hope that helps you make some progress. Hang in there.