Posts

Showing posts from November, 2021

Get the file details(Single and Multiple) that are selected using a File Browse Item using JavaScript in Oracle APEX

Image
  In this blog I will be explaining, how to get the details of a file(s), selected using a File Browse Item, using JavaScript in Oracle APEX. For Single File: 1) Create a Region . 2) Create an Item (Type: File Browse ) in the Region. (In this example:  P1_FILE_BROWSE ). 3) Create 3 More items in the page to store the File Name, File Size and File Type.                  (In this example: P1_FILE_NAME , P1_FILE_SIZE , P1_FILE_TYPE )  4) Create an On Change Dynamic Action on the  P1_FILE_BROWSE item. 5) Create a True Action (Type: Execute JavaScript Code ) and paste the below code. var $filebrowseItem = $("#P1_FILE_BROWSE"); var filebrowseItemLength = $filebrowseItem[0].files.length; var fileArray = $filebrowseItem[0].files; if (filebrowseItemLength > 0) { for (var i = 0; i < filebrowseItemLength; i++) { var fileName = fileArray[i].name; var fileSize = fileArray[i].size; var fileType = fileArray[i].type; apex.item( &q