Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\advnc_blob_forms.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>About BLOB in Forms</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-14T16:11:32Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="About BLOB in Forms" /> <meta name="relnum" content="Release 3.2" /> <meta name="partnum" content="E11947-01" /> <link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="up" href="preface.htm" title="Home" type="text/html" /> <link rel="up" href="advnc.htm" title="Advanced Programming Techni..." type="text/html" /> <link rel="up" href="advnc_blob.htm" title="About BLOB Support in Forms..." type="text/html" /> <link rel="up" href="advnc_blob_forms.htm" title="About BLOB in Forms" type="text/html" /> <link rel="prev" href="advnc_blob.htm" title="Previous" type="text/html" /> <link rel="next" href="advnc_blob_reports.htm" title="Next" type="text/html" /> </head> <body> <p id="BREADCRUMBING"><a href="preface.htm" title="Home">Home</a> > <a href="advnc.htm" title="Advanced Programming Techni...">Advanced Programming Techni...</a> > <a href="advnc_blob.htm" title="About BLOB Support in Forms...">About BLOB Support in Forms...</a> > About BLOB in Forms</p> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="advnc_blob.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="advnc_blob_reports.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BCGBHBFG" name="BCGBHBFG"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1><a name="HTMDB25904" id="HTMDB25904"></a>About BLOB in Forms<a id="sthref2282" name="sthref2282"></a><a id="sthref2283" name="sthref2283"></a></h1> <p>If you create a Form (either using the Create Application Wizard, create page of type Form - or Report and Form, or create region of type Form) or add an item to an existing form, any items whose source is a database column of type <code>BLOB</code> will result in an item of type File Browse. When the form is called for <code>INSERT</code>, the file selected by the user will be loaded into the <code>BLOB</code> column. When the form is called for update, a download link is displayed to the right of the Browse button. Users can use this link to download the file.</p> <div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref2284" name="sthref2284"></a> <h2><a name="HTMDB25905" id="HTMDB25905"></a>Populating the BLOB and Providing Download</h2> <p>The defaulted BLOB support does not give you all the information a typical application needs to effectively manage a <code>BLOB</code>. In addition to knowing that the column is a <code>BLOB</code>, more information about the file will provide a better experience for the end-user. To facilitate managing this additional information, the 'Source' attribute of an item has been extended to have additional components (in addition to <code>DB_COLUMN</code>):</p> <div class="inftblinformal"> <table class="Informal" title="Additoinal Item Source Attributes" summary="This table describes how the Source attribute of an item has been extended to support BLOBs." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <col width="11%" /> <col width="25%" /> <col width="13%" /> <col width="*" /> <thead> <tr align="left" valign="top"> <th align="left" valign="bottom" id="r1c1-t24">Position</th> <th align="left" valign="bottom" id="r1c2-t24">Attribute</th> <th align="left" valign="bottom" id="r1c3-t24">Required</th> <th align="left" valign="bottom" id="r1c4-t24">Description</th> </tr> </thead> <tbody> <tr align="left" valign="top"> <td align="left" id="r2c1-t24" headers="r1c1-t24">1</td> <td align="left" headers="r2c1-t24 r1c2-t24">Column containing <code>BLOB</code></td> <td align="left" headers="r2c1-t24 r1c3-t24">Yes</td> <td align="left" headers="r2c1-t24 r1c4-t24">Case sensitive name of column of type <code>BLOB</code>.</td> </tr> <tr align="left" valign="top"> <td align="left" id="r3c1-t24" headers="r1c1-t24">2</td> <td align="left" headers="r3c1-t24 r1c2-t24">MIME type Column</td> <td align="left" headers="r3c1-t24 r1c3-t24">No</td> <td align="left" headers="r3c1-t24 r1c4-t24">Case sensitive column name used to store the <code>MIME type.</code></td> </tr> <tr align="left" valign="top"> <td align="left" id="r4c1-t24" headers="r1c1-t24">3</td> <td align="left" headers="r4c1-t24 r1c2-t24">Filename Column</td> <td align="left" headers="r4c1-t24 r1c3-t24">No</td> <td align="left" headers="r4c1-t24 r1c4-t24">Case sensitive column name used to store the filename of the <code>BLOB</code>. If null, the column name is used as the default when user downloads the file.</td> </tr> <tr align="left" valign="top"> <td align="left" id="r5c1-t24" headers="r1c1-t24">4</td> <td align="left" headers="r5c1-t24 r1c2-t24">Last Update Column</td> <td align="left" headers="r5c1-t24 r1c3-t24">No</td> <td align="left" headers="r5c1-t24 r1c4-t24">Case sensitive column name used to store the last update date of the <code>BLOB</code>. If used, the HTTP header of the file download will indicate the date of last modification and browsers will be able to cache the BLOB. If not specified, the browser may not be able to cache files.</td> </tr> <tr align="left" valign="top"> <td align="left" id="r6c1-t24" headers="r1c1-t24">5</td> <td align="left" headers="r6c1-t24 r1c2-t24">Character Set Column</td> <td align="left" headers="r6c1-t24 r1c3-t24">No</td> <td align="left" headers="r6c1-t24 r1c4-t24">Case sensitive column name used to store the character set of the <code>BLOB</code>. Most relevant for Asian languages which may need to maintain the character set encoding.</td> </tr> <tr align="left" valign="top"> <td align="left" id="r7c1-t24" headers="r1c1-t24">6</td> <td align="left" headers="r7c1-t24 r1c2-t24">Content Disposition</td> <td align="left" headers="r7c1-t24 r1c3-t24">No</td> <td align="left" headers="r7c1-t24 r1c4-t24">Specify <code>inline</code> or <code>attachment</code>. All other values ignored. <code>attachment</code> is the default, <code>inline</code> can only be respected if a <code>MIME</code> type is specified.</td> </tr> <tr align="left" valign="top"> <td align="left" id="r8c1-t24" headers="r1c1-t24">7</td> <td align="left" headers="r8c1-t24 r1c2-t24">Download Text</td> <td align="left" headers="r8c1-t24 r1c3-t24">No</td> <td align="left" headers="r8c1-t24 r1c4-t24">String used for the download link. If nothing is provided, <code>Download</code> will be used. Note this will support substitutions (useful for translated applications).</td> </tr> </tbody> </table> <br /></div> <!-- class="inftblinformal" --> <p>Consider the following example:</p> <pre xml:space="preserve" class="oac_no_warn"> RESUME:RESUME_MIMETYPE:RESUME_FILENAME:RESUME_LAST_UPDATE::attachment:Resume </pre> <p>If you have an item of type File Browse, whose source is Database Column that contains at least one colon (for example, <code>RESUME:</code>), you will see a link below the Source <code>BLOB Download Format Mask</code>. This popup assists in entering all the parameters necessary for the BLOB format.</p> <p>At a minimum, you must specify the database <code>BLOB</code> column with at least one trailing colon (for example, <code>RESUME:</code>). This preserves compatibility with Oracle Application Express release 3.0.1.</p> <div class="inftblnotealso"><br /> <table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">Tip:</p> To see a real example, go to Sample Application, page 6 (Add/Modify Products), and review the item P6_PRODUCT_IMAGE. See <a href="demo.htm#CEGIBAGC">"Running a Demonstration Application"</a>.</td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnotealso" --> <p>To provide this additional information, Oracle recommends you add additional columns to your base table to store and track the <code>MIME</code> type and file name attributes. You can accomplish this simply by extending your table, for example:</p> <pre xml:space="preserve" class="oac_no_warn"> ALTER TABLE emp ADD (ATTACH_MIMETYPE VARCHAR2(255), ATTACH_FILENAME VARCHAR2(255), ATTACH_LAST_UPDATE DATE); </pre> <p>If you manually create a form, you can still take advantage of this feature. You simply use the format described within an item of type File (File Browse) on a page with a DML Process of type <code>DML_PROCESS_ROW</code>. This process will determine the table name and primary key columns.</p> </div> <!-- class="sect3" --> <div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref2285" name="sthref2285"></a> <h2><a name="HTMDB25906" id="HTMDB25906"></a>Displaying the BLOB</h2> <p>If the BLOB you are working with is an image, you can display it in the form as well. See <a href="advnc_blob_methods.htm#BCGHJEBD">"Working With BLOBs Procedurally"</a>.</p> </div> <!-- class="sect3" --> <div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref2286" name="sthref2286"></a> <h2><a name="HTMDB25907" id="HTMDB25907"></a>Removing the Image Reference</h2> <p>Because there is no set to <code>NULL</code> when using File Browse, if you need to provide a mechanism to remove an image reference, you must include a special Remove Image button to nullify the necessary columns. Consider the following example:</p> <pre xml:space="preserve" class="oac_no_warn"> UPDATE demo_product_info SET product_image = NULL, MIMETYPE = NULL, FILENAME = NULL, IMAGE_LAST_UPDATE = NULL, CHARSET = NULL WHERE product_id = :P6_PRODUCT_ID; </pre> <div align="center"> <div class="inftblnotealso"><br /> <table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">Tip:</p> To see a real example, go to Sample Application, page 6 (Add/Modify Products), Delete Image process. See <a href="demo.htm#CEGIBAGC">"Running a Demonstration Application"</a>.</td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnotealso" --></div> </div> <!-- class="sect3" --></div> <!-- class="sect2" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="advnc_blob.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="advnc_blob_reports.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de