File Browser in APEX 4 with BLOB column specified in item source attribute

In APEX 4, we now have the option to place where the uploaded file will be stored within the development workspace interface. The Storage Type setting of the File Browser item has two options:

File Browser Settings

  • Table WWV_FLOW_FILES stores the uploaded file in the table wwv_flow_files (or APEX_APPLICATION_FILES).  This is the default way in the previous versions of APEX. Note that if you still decide to store the uploaded files this way, it is suggested to move record to another custom table after upload, and then clean it up in this table because this is the shared default area (table) where every application will upload files to.
  • BLOB column specified in item source attribute will store the uploaded file in a custom table identified in the Automatic Row Processing (DML) process and the column specified in the item source attribute. This column has to be of data type BLOB.

To configure the File Browser with the BLOB column specified in item source attribute.

1. Create a table for storing uploaded files. One of the columns must be BLOB data type.

CREATE TABLE tbl_attach_file
  attach_id          NUMBER PRIMARY KEY,
  attach_data        BLOB,
  attach_mimetype    VARCHAR2(255),
  attach_filename    VARCHAR2(255),
  attach_last_update DATE ,
  attach_charset     VARCHAR2(128),
  attach_user        VARCHAR(10)


   ON tbl_attach_file
     INTO :NEW.attach_id

2. Create a File Browser item with the following settings.

If this is just simply for file upload, select No on Display Download Link. Otherwise, it will require additional Automated Row Fetch (DML). See note and comment below.

File Browser Settings

3.  The item’s source points to the BLOB column.

File Browser Source

4. Create an Automatic Row Processing  (DML) process.


5. Create a button called Upload with Database Action – SQL Insert Action.

Initially I thought this should be sufficient, but when I ran the page, I got this error.

No DML Error

Apparently I got this error because I checked Yes to Display Download Link thus it requires a DML to fetch data. If this is set to No, it should be okay without the following Automated Row Fetch (DML). Thanks Patrick for pointing that out.

To workaround this, I created another DML but for Automated Row Fetch.

DML Fecth

For a purpose of blogging, we’re not going to run any row fetch, so the DML Fetch will have it disabled (its condition to Never). I’m still not sure why the Automated Row Fetch (DML) is needed (even being disabled) if we just want to upload files. But if it is not there, I got the ORA-2001: No Corresponding DML process shown in step 5.

A quick test shows that the file is uploaded to our custom table.

Upload Test

According to Oracle APEX document, the character set of the BLOB is not automatically set on upload. We will have to create an additional page item which is bound to the character set column. This will be where users can specify the character set for the file they are uploading.

, , , , ,

50 Responses to File Browser in APEX 4 with BLOB column specified in item source attribute

  1. Patrick Wolf March 17, 2011 at 11:59 am #


    the DML Fetch process is required in your example because you have enabled the “Display Download Link” feature, which requires the fetch process so that it knows where it has to read from. If you set that flag to “No”, the “Automatic Row Processing (DML)” should be sufficient.


    • ittichai March 17, 2011 at 2:45 pm #

      It is great to know that. Thanks for clarification.


  2. Mauricio June 7, 2011 at 11:26 am #

    I created my page following your rules but when I ran the application to save an image it just doesnt Error: ORA-01403:no data found any solution?

  3. Mauricio June 7, 2011 at 2:39 pm #

    Now I run a report to show te file or an omage but it just doesnt appear the rest of the data is ther but the field that contains the blob shows empty – how should i download it to a report

    • ittichai June 7, 2011 at 10:24 pm #

      @ Mauricio how to do display data? Some tools might not be capable of display file content or image. Have you confirm with DBMS_LOB.GETLENGTH? I just want to double check.

      • Mauricio June 8, 2011 at 5:08 pm #

        Thanks ittichai for taking your time finally repeated the report and now it just work know i have another plobem trying to break after a column but i think that may be another thread

      • Mauricio June 8, 2011 at 5:24 pm #

        Ireally need that help I have a table named items with images shirts, skirts, pants, and another table with sizes and another one with colors, The item table has an image of each item but when i join 2 o 3 of this tables de image of course respeat it self for each characteristic I mean size 32
        size 34
        size 38
        is an image on the table items and i would like to show the image with all sizes but the image one time only like this

        size 32
        size 34
        size 38

        Is this possible? How?

  4. Mauricio June 8, 2011 at 5:26 pm #

    Ireally need that help I have a table named items with images shirts, skirts, pants, and another table with sizes and another one with colors, The item table has an image of each item but when i join 2 o 3 of this tables de image of course respeat it self for each characteristic I mean $pants$ size 32
    $pants$ size 34
    $pants$ size 38
    $pants$ is an image on the table items and i would like to show the image with all sizes but the image one time only like this

    $pants$ size 32
    size 34
    size 38

    Is this possible? How?

    • ittichai June 8, 2011 at 10:22 pm #

      @Mauricio I think you’re probably looking at an inline view for size – something like this select $pants$, (select size from size-table where …) from pants-table. But you have to manage how to display sizes in the 2nd column in the concatenated format.

      • Mauricio June 9, 2011 at 11:32 am #

        I tried to do that
        Select a.image_id, a.item_image, (Select b.color_desc from colors where a.image_id = b.image_id) from items a

        but i got this error:

        ORA-12899: value too large for column “APEX_040000″.”WWV_FLOW_WORKSHEET_COLUMNS”.”DB_COLUMN_NAME” (actual: 63, maximum: 30)

        Unable to create Dynamic Query page.

        what should I do

        • ittichai June 9, 2011 at 2:13 pm #

          Your error indicated that data is too big (63 chars) for column size (30 chars).

          Note that for the inline view (if one image_id has multiple colors), you’ll need to concatenate to return one row (may be using “,” or “new line”), otherwise it will fail.

  5. Mauricio June 9, 2011 at 3:19 pm #


  6. Mauricio June 9, 2011 at 5:36 pm #

    Thank u i just got how to show some rows in in one string thats great but now there anothe problem when i use a third table for example
    pants jean blue
    lino white
    then the report shows like this

    pants blue black pink jean jean jean

  7. mauricio June 10, 2011 at 10:03 am #

    I will explain in a more real way
    have 4 tables Items, colors, materials, item_definition
    items have patch cords, optic fiber, switchs, routers
    colors black, white, red, green, gray
    material plastic, cuper, alumnium

    on table item definition there are many rows with exactly each item color and material
    I mean patch cords black plastic
    patch cords white plastic

    switch white null
    switch black null

    optic fiber white plastic
    white aluminium
    i need to show patch cords black, white plastic
    switch black, white
    optic white plastic, aluminium

    but i get patch cords black, white plastic, plastic
    switch black, white
    optic white, white plastic, aluminium

  8. Joel June 10, 2011 at 1:28 pm #

    Hi i need to creat a multi-select fiel in my form but when i try to insert the error is declare

    Invalid numeric value 3:1:2 for column level my idea is a form where yo insert which level has a student passed for example

    Student Level
    Joel 1
    Joel 2
    Joel 3

    so in my form i select the student and in a multi select list select the 3 levels but when i save there goes the error, How can i insert a multirow select list in apex 4

  9. Mauricio June 11, 2011 at 11:59 am #

    Thank that really helped me, now I need something else when I execute than way to present a multi row registry I get some parameters repeated for example
    I have
    Item Color Fabric
    Jackets yellow jean
    Jackets blue jean
    Jackets black jean
    Jackets black leather

    with a query like that i get

    Jackets yellow blue black black jean jean jean leather

    I need to show yellow blu black jean leather
    Is ther a way to make something like a distinct yin that kind of query?

  10. Mauricio June 17, 2011 at 4:40 pm #

    I am sorry about tghis but I cant find any answer about this either any forum Im trying to work with progress lists but when I create a region list type doesnt follow the sequence why, I´ve listened that some people have problems with this in apex on spanish but thats not my problem my apex is on english but still cant get it work help me please .
    If this theme is for another forum indicate me where should i post this

  11. Alberto July 8, 2011 at 10:58 am #

    Hi, I really need some help, I have a new tabular form based o an empty table for shipping orders, all the fields from this empty orders table are, of course, called from other tables so i make them all select list but there are som fields that i need to be filled when this selecs chage i mean
    articule v | seccion v | subseccion v | cuota |
    select lists articules, seccion and subseccion
    quota is a field on table articules that, when i select and articule the quota should be filled but how i do that

    • ittichai July 8, 2011 at 11:30 am #

      I think you can programmatically assign value of any columns. They are referred to as

      document.wwv_flow.fXX (in Javascript)
      or apex_application.g_fXX (in PL/SQL)

      You can use PL/SQL block for validation or process. (See sample at, or using javascript (


      • Alberto July 8, 2011 at 12:03 pm #

        It doesnt work i need that when I choose an articule inmidiately the field quota is filled

        • ittichai July 8, 2011 at 12:07 pm #

          For immediate action you will have to use javascript. If there is a need to access database in the background, look into AJAX as well. Google for “APEX javasript AJAX”. There are many articles written about it.

          • Alberto July 8, 2011 at 12:11 pm #

            So if i need to multiply this quota with another value I shoul enter Its also an ajax way to do?

  12. Alberto July 8, 2011 at 12:13 pm #

    I found some code for ajax but dont know how to use it where should i put this code yin the page like a process in the field where

  13. Alberto July 8, 2011 at 12:29 pm #

    That ajax should be helpful if the code were used foe tabular forms I mean with field but its just explain for textfield on a regular form “PXX_#######” that really doesnt help me a need to use de code for report fields on a tabular form

  14. Matt August 1, 2011 at 6:30 pm #

    I have the same file upload. If my form validation fails returning the user to the form, the file upload field is empty…and my user has to re-select a file to be uploaded. Any idea how to avoid this? Thank you.

    • ittichai August 2, 2011 at 9:06 am #

      I’m not sure how to do that. At least the file browser will stay at the directory where you last selected. My suggestion is that you could try a dynamic action where you save the text every time the selection is changed.

      • Eel December 12, 2011 at 5:03 am #

        Thanks for introducing a little rtanoiality into this debate.

  15. Vas October 16, 2011 at 4:52 am #

    I have followed the same steps but the file I upload gets stored in the wwv_flow_files table and not in the custom table I have defined. Any suggestions to resolve this would be very helpful.

    • ittichai October 16, 2011 at 9:10 am #

      I assume you choose “BLOB column specified in item source attribute”?

      • Vas October 25, 2011 at 2:49 am #

        Yes, I chose “BLOB column specified in item source attribute”. However, it always gets stored in the WWV_FLOW_FILES table instead of the custom table I have created.

        Does any setting in APEX prevent us from using custom tables?

        • Vas October 25, 2011 at 2:51 am #

          I would wonder how I would share the application as its in the intranet. I would try to replicate the same in the Oracle’s Apex instance on the Internet so that you can help me debug the same.

          • ittichai October 25, 2011 at 10:29 am #

            You can use where the workspace can be requested for free. Most people are using it to share samples or collaborate. But keep in mind, with my busy schedule, I might not have a chance to take a look for awhile.

  16. Ray October 25, 2011 at 4:09 pm #


    I am a biz user and not very technical (but am learning as I go.)This was a very easy to understand article. Thank you for laying it out as you did.

    Is there a part 2… How to create the download section so that users and get the uploaded attachments?


  17. kishore chepuri December 5, 2011 at 3:07 am #


    This is kishore chepuri. would u please tell the steps for sending the blob data to a pdf in apex with sales force.

  18. kishore chepuri December 7, 2011 at 7:58 am #


    I want to display the pdf as reports . As we generated in salesforce. I am unale to convert into pdf format. Please help for this.

    • ittichai December 7, 2011 at 9:22 am #

      I believe this has to do with http header information. Please try to add this line and see.

      OWA_UTIL.mime_header (NVL (l_mime, ‘application/pdf’), FALSE);

  19. sree May 30, 2012 at 5:51 am #

    I am getting “NO Data Error”..How to Resolve this

    • ittichai May 30, 2012 at 8:06 am #

      I would recommend you to debug your codes using Toad or SQL Developer. Just simply set the group security ID in the tool so you can access APEX from external tool.

  20. Pat Miller June 18, 2013 at 1:29 pm #

    I have tried your example trying to load a .csv file into the Blob column of your example table, but have not been successful. One question I had was, it was not clear to me the source for the Primary key for the DML process definition. It appears to be the Item name for the File Browse item according to your screen shot, but the Item name of the File browse item has a source of the ‘attach_data’ column which is not the primary key of the table.


  21. Ashish July 8, 2013 at 4:50 am #

    hi ,

    I have a java exception stack trace which I have stored in the DB as BLOB. Now, I want to display the BLOB data as text on the oracle apex page/popup.

    I am using a DB link and it oracle apex throws an error if I create a display item for the remote DB.

    Can you please help me here,

  22. ahmed February 20, 2014 at 12:32 am #

    I want to upload excel and csv file in apex temp table througt file browser is it possible ?

    • ittichai February 20, 2014 at 5:41 pm #

      Yes, from APEX 4.1+, you can use wizard to create “data upload” pages where you can use the file browser to load the existing CSV (or other delimiters) file and load into a database table. For excel upload, it is a bit tricky. But Denes has written a good post and sample on how to do it at (Note that it requires APEX listener.)

  23. Pat Miller May 16, 2014 at 1:07 pm #

    I have a process which creates files of consolidated configuration data from many machines on our college campus. I now want to automate an upload of this consolidated file from the machine which holds the file. Can this be done using an Apex application which runs a process to upload the file, parse it and then insert into a table?


    • ittichai May 16, 2014 at 2:51 pm #

      If those files are visible to database server, you can do external table or sqlloader. Either can be scripted very easily.

  24. Rajkumar May 21, 2014 at 6:46 am #


    Currently i am working on File upload using BLOB Content.
    I am facing an issues with upload button. After browsing my upload file (ex: test.csv) then click on upload button the upload button got disappears. i need another help, can we restrict the upload files only csv. please provide sample code.


    • ittichai May 25, 2014 at 10:29 pm #

      Button disappearing may be an issue with your current APEX. Try some other APEX installation or

      You can restrict only .csv just simply by validating the file extension.


  1. Create an Application to Upload Files Using Oracle APEX, In Less Than 10 Minutes (Video) » Eddie Awad's Blog - September 20, 2011

    […] APEX includes declarative BLOB support that enables you to declaratively upload files in forms, and download or display files in reports (ittichai wrote about it here). […]

Leave a Reply

Powered by WordPress. Designed by WooThemes