This discussion is archived
3 Replies Latest reply: Mar 8, 2013 12:46 PM by bondurs RSS

File in File Browse item disappears if validation fails on any item ....

bondurs Newbie
Currently Being Moderated
Greetings:

I'm using APEX 4.0. I have a region with 7 data elements, one of them being a File Browse page item. The BLOB file loads in the WWV_FLOW_FILES table first, then in the "After Submit" page processing, I move the BLOB into my own custom table. This works great in normal processing.

However, if any of the other data elements in this region fails validation, the page renders with the validation messages, but the file in the File Browse page item disappears. Therefore, the user would have to re-select the file to upload before they resubmit and process the page again.

How can I avoid this? Why does the path and file name disappear when page validation fails?

Thanks,
Stan
  • 1. Re: File in File Browse item disappears if validation fails on any item ....
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    I think the file browse item is protected and can't be manipulated using any process or script. You have two posibilities:

    1. You can display the validation error on an error page and clicking the "OK" button would redirect to the form and you should see the document path in the file browse item

    2. You can use client side validation like described in this posting:

    http://apexplained.wordpress.com/2013/02/28/client-side-form-validation-in-apex/

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------
  • 2. Re: File in File Browse item disappears if validation fails on any item ....
    fac586 Guru
    Currently Being Moderated
    bondurs wrote:
    Greetings:

    I'm using APEX 4.0. I have a region with 7 data elements, one of them being a File Browse page item. The BLOB file loads in the WWV_FLOW_FILES table first, then in the "After Submit" page processing, I move the BLOB into my own custom table. This works great in normal processing.

    However, if any of the other data elements in this region fails validation, the page renders with the validation messages, but the file in the File Browse page item disappears. Therefore, the user would have to re-select the file to upload before they resubmit and process the page again.

    How can I avoid this? Why does the path and file name disappear when page validation fails?
    It is a required security feature. Per the HTML specification, APEX will not render a value in a file browse item on page show. This protects the user from nefarious persons changing the file item value during spurious "failed" validation (hoping the user is distracted correcting the "failed" item and does not notice) in order to capture a file the user does not intend to submit (e.g. /etc/passwd).
  • 3. Re: File in File Browse item disappears if validation fails on any item ....
    bondurs Newbie
    Currently Being Moderated
    Thanks for your answers.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points