Oracle Apex Image Preview on Browse - Javascript in Dynamic Action

 Showing image on Browse Image You can go for the following code:

You have to create a file browser item on your page you have to create a file browser item  on your page and add the below code into the post text section.

post text section :

<canvas id="image-preview" width="100" height="50"></canvas>

Dynamic action on change :

Identification:- Action>Exectue Javascript Code

var canvas = $x('image-preview');
var ctx    = canvas.getContext('2d');
var img = new Image;

img.src = window.URL.createObjectURL(this.triggeringElement.files[0]);
img.onload = function() {
  if (img.width > 200) {
   canvas.style.width = "50px";
  } 
  canvas.width = img.width;
  canvas.height = img.height;
  ctx.drawImage(img, 0, 0);
  $("#container-img-preview").show();
}



You can create Query on Image Item and use the following Query:

select "ID","NAME","MIMETYPE","FILENAME","IMAGE_LAST_UPDATE",
sys.dbms_lob.getlength("IMAGE")"IMAGE"
from "DEMO_COMPANY"



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