How to upload image in oracle forms 11g

Download Link : https://drive.google.com/drive/folders/1sUqz5WIOnQzHtvjTeF_2h1ExX0x6dudV?usp=sharing


1-Purpose :

  When you want to load images from the client machine to the database, you would like to choose the right image file with a preview of each image.

  This is a Javabean component that allows to display a JfileChooser dialog box with image preview.

  It also allows to display at the same time different file types.


2-Forms configuration:

  Copy the GetImageFileName.jar file in the /forms/java directory

  Edit the /forms/server/formsweb.cfg file to add the jar file to the archive_jini variable

  archive_jini=f90all_jinit.jar,……, GetImageFileName.jar


3-How to implement this bean in your own form

  Open your form

  Add a Javabean component to any block

  Register the bean (be sure that it is not in a When-New-Form-Instance trigger, or use a timer)

  FBean.Register_Bean('BLOCK.BEAN_ITEM',1,'oracle.forms.fd.GetImageFileName'); 


4-Invoke the bean’s GetFile() function

  The background color of the button

  CHAR := FBean.Invoke_char('BLOCK.BEAN_ITEM',1,'GetFile','"Dialog box title","start directory"');

  e.g.

  :BL1.File := FBean.Invoke_char('BL1.IMAGEPICKER',1,'GetFile','"Select an image file name","M:\"');


5-The sample dialog

  Download the imagefilechooser.zip file

  Unzip the imagefilechooser.zip file

  Copy the GetImageFileName.jar file in your /forms/java/ directory

  Edit your /forms/server/formsweb.cfg file

  Open the IMAGEFILECHOOSER.fmb module (Oracle Forms 9.0.2)

  Compile all and run the module


CREATE TABLE IMAGE_TEMP

(ID                                                             NUMBER(1),

IMAGE                                                          BLOB,

IMAGEFILENAME                                                  VARCHAR2(1000)

);


WHEN-NEW-FORM-INSTANCE:

:GLOBAL.IS_BEAN_REGISTER := 'false' ;

  Set_Window_Property

  (

    FORMS_MDI_WINDOW, 

    TITLE, 

    'Oracle Forms 9i/10g - Javabean'

   ) ;

WHEN-BUTTON-PRESSED:

If :GLOBAL.IS_BEAN_REGISTER = 'false' Then

  FBean.Register_Bean('IMAGE_TEMP.BEAN_AREA10',1,'oracle.forms.fd.GetImageFileName');  

  :GLOBAL.IS_BEAN_REGISTER := 'true' ;  

End if ;


:IMAGE_TEMP.IMAGEFILENAME := FBean.Invoke_char('IMAGE_TEMP.BEAN_AREA10',1,'GetFile','"Select an image file name","M:\"');

read_image_file(:IMAGE_TEMP.IMAGEFILENAME,'jpg','image_temp.image'); 



Muhammad Abdullah Al Noor

Muhammad Abdullah Al Noor, An Oracle Apex Consultants and founder of Noors Technology (www.noorstech.com). Core Expertise : Database Administration, Oracle Forms and Reports Development, Oracle Apex Application Designer and Development, Linux Professional etc. Also the owner of TrainerBD Training and OraDemy E-Learning. WhatsApp +8801790721177

Post a Comment

Previous Post Next Post