Upload Image on Oracle Forms and Saved into Database through Webutill

Prerequisite: Successful configuration of webutil.

Here is a guide for webutil configuration.

Steps:

  • Open Oracle forms builder 11g Create a new form,a new block & a canvas.
  • Attach webutil.pll on Navigator—> Attached Libraries in Forms.
  • Click file—>open—>C:\Oracle\Middleware\Oracle_FRHome1\forms\webutil.olb click webutil.olb file and it will create some entries in object library (in navigator)
  • Click on object libraries there u have webuitl, right click on webutil chose option object library.
  • There you have 2 webutil objects.
  • Drag webutil object to object group (in navigator window) subclass it.

 

  • Run form in case of error try this: In webutil block there is block level trigger when_custom_item_event edit it by replacing null in its code;

BEGIN

NULL;

END;

  • Create table in database:

CREATE TABLE LOBS_TABLE

(

BLOB_ID     NUMBER,

IMAGE_BLOB  BLOB

)

  • Create form by using wizard add these 2 DataBase items on form.

 

  • Code behind upload button:

declare

vfilename varchar2(3000);

begin

vfilename := client_get_file_name(‘c:\’, file_filter => ‘ image files (*.jpg)|*.jpg|’);

read_image_file(vfilename, ‘jpg’,’lobs_table.IMAGE_BLOB’);

write_image_file(vfilename,’jpg’,’lobs_table.IMAGE_BLOB’,maximize_compression,ORIGINAL_DEPTH);

—   commit_form;

end; http://domycoursework.hatenablog.com/