Skip to Main Content
Feature Request FR-3569
Product Area Page Components
Status DELIVERED

6 Voters

The new File Upload item contains a 'remove' button, which doesn't work intuitive.

lbrizzi Public
· Jan 2 2024

Idea Summary
The new File Upload item contains a 'remove' button, which doesn't work when updating a record. Not sure if this is a bug or intended behavior.

Use Case
When updating a record.

Preferred Solution (Optional)
Make the remove action declaritative configurable. Whether to show it or not, pl/sql handling behind the button, etc.

This has been delivered in Oracle APEX 24.2 as part of bug 36064312!

Comments

Comments

  • neil.fernandez APEX Team OP 1.5 years ago

    Are you referring to the x icon?

    For more context I believe you are referring to the following situation:

    - Source = BLOB Column… 
    - In combination with Form - Automatic Row Processing.

    And not Table APEX_APPLICATION_TEMP_FILES. Because with the latter it requires your own processing, which you would do you own file handling.

    This may be considered a potential bug, as the x should clear the blob column.

  • lbrizzi OP 1.5 years ago

    Hi, 

    Yes, thats correct, the x-icon.

    Indeed not the table APEX_APPLICATION_TEMP_FILES from wwv_flows_files.

  • plamen.petrov OP 1.5 years ago

    Hi,

    I have exactly the same problem.

    So, is it a bug? fix/workround? I am on APEX 23.2.1.

  • shilpi.pauranik OP 1.1 years ago

    Hi,

    I am experiencing the same issue. When will this be resolved?

  • jayson hanes Admin OP 1.1 years ago

    Eventually. It is marked as a low priority.

  • caio.oliveira OP 11 months ago

    I was able to address this problem creating a computation on the upload image item

    On the computation,

    I put server-side condition as: when my upload image is null 

    then

    on the computation tab 

    static value = null

  • mike.kruijsdijk OP 10 months ago

    Thanks! Please note that the computation execution must be Point: After Submit

  • alan arentsen OP 3 months ago

    If you use the image upload item in 24.2 as an Icon Dropzone with own BLOB storage, there is an error setting a tabindex attribute on the remove icon. In 24.2, is seems there has been made an effort of disabling the remove icon.

    So, for what it's worth, I have made a workaround in JavaScript.

    • Add a Custom Attribute in the advanced section of the Image Upload item on your page. This wil show/hide the icon when needed.
    show-clear-button="true"
    
    • Add my Javascript code to the global JavaScript file, or just load it on the page. It will add a click handler to the DOM. When the remove icon is clicked, a dummy empty file will be created and enqueued to the input files list.
      There is a timeout because there is another event on the same DOM element, this event changes the DOM to make it look like there is no file AND it cleares the input files list.
    let $fileUpload = $('a-file-upload[show-clear-button]');
    $fileUpload.each((index, element) => {
        $fileUpload.on("click", (event) => {
            if (event.target.closest('.a-FileDrop-remove')) {
                event.preventDefault();
                setTimeout(() => {
                    dataTransfer = new DataTransfer();
                    file = new File([], 'no_file');
                    dataTransfer.items.add(file);
                    element._wrappedElement$[0].files = dataTransfer.files;
                }, 50);
            }
        });
    });
    

    Hope this helps!

  • yuri.kfreitas OP 7 weeks ago

    Another thing that would be very useful is to allow/disallow users to remove the BLOB file, maybe with a authorizathion scheme… it is so simple and it would help a lot

  • sonsistem OP 6 weeks ago

    @alan arentsen Thank you, works like a charm

  • alan arentsen OP 5 weeks ago

    @yuri.kfreitas can you use the read only attribute on the item?