File Browse is emptied after failed validation

Why does the file browse text box get emptied after a failed validation? Is there any way to prevent this?
To further explain, create a form on a page with two page items, a text box and a file browse item, then put a not null validation on the text box. When you submit the page with a null text box, but with a file selected for the browse button, then validation catches and throws the error message back to the user when the page refreshes. However, the file browse text box is emptied, and the user has to reselect the file before resubmitting the page.
Is this a bug, or just the way it is supposed to work? Any way around it?
Thanks,
Kris
Edited by: kshenn on Oct 31, 2008 7:06 AM

Hello,
>> Is this a bug, or just the way it is supposed to work?
This is not a bug. Actually, it has nothing to do with APEX. The behavior of the file browse item is controlled by the HTML standard, which clears the field for security reasons.
If you pay close attention to Denes example, you’ll see that even when the validation error page is displayed, the file browse item itself is being cleared. The JavaScript generated file path is the one that retain its value. I don’t have access to Denes code, but I’m assuming that in his uploading procedure he’s using the JavaScript generated path.
>> Any way around it?
Where the file browse item is concern, no workaround.
In your specific case, where the validation you need is “not null”, you can create a JavaScript validation, and fire it before submitting the page (as part of the submit button). That way, the browser will not clear the file browse item, because the page will not be submitted without proper values in your items.
Regards,
Arie.

Similar Messages

  • Iphone file browser stopped working after upgraded to IOS 5

    Hi,
    I have an iphone 3gs which I have recently upgraded to IOS 5. But to my horror after I have done that I can no longer browser my iphone's internal storage. Iphone connected to PC via USB, the file explorer no longer available. It can still sync with itune fine but there is noway I can access the storage locater in the phone via file explorer like I used to. Mind you I still have 3GB of space there.
    Is that a bug? Or I stuffed up the upgrade some where?
    Anyone else had this experience?
    Alex

    I know whats wrong now...
    My phone had been emptied after I last restored it, after I took a picture and insert the phone back to the PC. The file browser shows up again...
    That means if there is nothing in the phone, the file browser wouldn't be too bother to even show up. Weird one...

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

    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

    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).

  • Checking filename length in File Browse item before uploading

    I have a File Browse item from which users can upload files into the database. Within APEX, the file metadata and content first get uploaded into the view WWV_FLOW_FILES. By design apparently, the underlying table for this view has a NAME field which is limited to 90 characters. I would like to test the length of the Name field and provide a warning to the user if the name exceeds 90 characters, but any validation I write to that effect does not "fire" until after the file has been uploaded to the WWV_FLOW_FILES view. That attempt to upload apparently is the first thing that happens when you Submit with a File Browse item, even before the validation. If the name of the file exceeds 90 characters in length, the attempted upload errors out with a generic Page Not Found error. Is there any way to capture the length of the Name of the file with a File Browse item prior to the attempt to upload to the WWV_FLOW_FILES view, or is my only option just to put a warning banner on the page?

    Hello Mike,
    >> Column NAME in WWV_FLOW_FILES is VARCHAR2(90). It does not include the local filename path. It include a prefix like "F1521676842/" in the front of the filename.
    Yes, you are correct. I spoke from memory, and it seems that I remembered one of my customized tables, where I also save the local full path of the file.
    As far as I can see in my system, the extension of the ‘F123….’ is not with a fix length, and the highest one is 18 characters long. Therefore, it seems that the actual file name should be less than 70 characters long.
    A similar code to the following can be used in a validation check:
    <script type="text/javascript">
    function checkFileName(pThis){
      if (pThis.value != "") {
         //get path value (including file name)
         var fileAndPath = pThis.value;
         //find the index of the last "\"
         var lastPathDelimiter = fileAndPath.lastIndexOf("\\");
        //get everything after the last "\"
        var fileNameOnly = fileAndPath.substring(lastPathDelimiter+1);
        if (fileNameOnly.length >70) {
          alert("File name " + fileNameOnly +
              " is too long (" + fileNameOnly.length + " characters).");
          pThis.focus();
    </script>The “HTML Form Element Attributes” of the item should include:
    onblur=" checkFileName(this)"
    Regards,
    Arie.

  • File Browse Validation not stopping upload

    Hi Guys,
    I am using Apex 4.0 and need help with the following please:
    I have a file browse item which uploads a file into the built in WWV_FLOW_FILES. The problem is it uploads even when there is an error and my validation flags up.
    Is it supposed to, does anyone no a work around? Basically I dont want the end user to upload the same file more than once.
    Thanks in advance all
    Spam

    I have a file browse item which uploads a file into the built in WWV_FLOW_FILES. The problem is it uploads even when there is an error and my validation flags up. Is it supposed to...Yes. The file data is just the same as any other form value, and has to be submitted and held in session state (in this case in <tt>APEX_APPLICATION_FILES</tt>) before APEX can do anything with it:
    {thread:id=902770}
    Basically I dont want the end user to upload the same file more than once.You'll have to perform some kind of validation check for this and if it fails, delete the unwanted file:
    {thread:id=1772863}

  • Validating File Browse path is valid

    I'm sure some other people ran into this same problem...
    I need a way to validate the file entered into the File Browse item is a valid file path. I've created an obvious "not null" validation so the item has a value when the page is submitted. I also created a validation to check the size of the file if a path was given. I noticed if there is something resembling a file path but the file name is not correct APEX will upload an empty blob.
    DECLARE
      v_file_id APEX_APPLICATION_FILES.ID%TYPE;
      v_file_filename APEX_APPLICATION_FILES.FILENAME%TYPE;
      v_file_doc_size APEX_APPLICATION_FILES.DOC_SIZE%TYPE;
      v_file_blob_content APEX_APPLICATION_FILES.BLOB_CONTENT%TYPE;
      v_file_mime_type APEX_APPLICATION_FILES.MIME_TYPE%TYPE;
    BEGIN
      SELECT ID,FILENAME,DOC_SIZE,BLOB_CONTENT,MIME_TYPE
        INTO v_file_id, v_file_filename, v_file_doc_size, v_file_blob_content, v_file_mime_type
        FROM (
          SELECT ID,FILENAME,DOC_SIZE,BLOB_CONTENT,MIME_TYPE
            FROM APEX_APPLICATION_FILES
           WHERE UPDATED_BY = UPPER(:APP_USER)
          ORDER BY UPDATED_ON DESC
       WHERE ROWNUM = 1;
       IF v_file_doc_size = 0 THEN
         DELETE FROM APEX_APPLICATION_FILES WHERE ID = v_file_id;
         RETURN FALSE;
       END IF;
       RETURN TRUE; 
    END;Now the problem is when a user enters some random text like "abc.pdf" into the file browse item. Is there a way to validate that this doesn't happen. In our current application it appears that the page is never submitted when a button is clicked. I put up an application on apex.oracle.com and I receive a javascript error when I try to submit a page with a relative file path like "abc.pdf".
    If I can't create a validation is there a way to make the file browse item read only so they have to use the button and can't type the file path?
    Thanks!
    Jonathan
    APEX 4.0

    Hi,
    Tried it, here is what happened
    IE 8 in Browser  Mode : IE 8, Document Mode: IE8 Standards
    - I am unable to enter any text in the item
    IE 8 in  Browser  Mode : IE 8 Compatibilty, Document Mode : IE7  Standards
    - I am unable to enter any text in the item
    IE 8 in Browser  Mode : IE 7 Compatibilty, Document Mode : IE7  Standards
    - I am unable to enter any text in the item
    FF 3.5.7
    - As soon as I key in text it automatically opens the File Browser Dialog box.
    So, there is some issue with either IE7 or something else.
    If someone from Oracel does not look at this thread then I suggest you post another query with the words bug? in it.
    Regards,

  • IPad/iPhone file browser (iPhone Explorer) no longer working after iTunes update

    iTunes freezes up on me a lot when I connect my iPad, so I prefer to add files to apps using a file browser like iPhone Explorer. However, after this most recent iTunes/Quicktime update, this and other programs like it don't work.
    My computer is running Windows XP (yeah, I know it's old, but I'm not made of money!). I have an iPad 2 with the most recent iOS version installed.
    Here's the error message iPhone Explorer gives me:
    "iPhone Explorer is unable to load the app directories because the version of CoreFoundation.dll installed on your system doesn't work properly. This sucky DLL likely got on to your computer because of a recent update in the Safari web browser. Because this sucky DLL is shared between many other Apple programs, reverting back to the non-sucky version is more complicated than just uninstalling and reinstalling a couple programs. We recommend waiting a couple months for the next Safari update and hopefully Apple will have this stuff fixed then."
    I don't have Safari installed on my computer. Just iTunes (and Quicktime).
    As a result, you can't browse the app directories, so you can't add any files to apps. I tried uninstalling iTunes and replacing it with an older version, but it wouldn't open because it said the library file was created by a "newer version." I'm also having some trouble even getting iTunes to show the files in my apps (under iPad -> Apps -> scroll to bottom of the screen), but that might just be a symptom of my old iTunes-freezing problems.
    I'm kind of stuck. Anyone else experience this problem or have any suggestions? Thanks!!

    That's XP SP3 I hope?   iPhone Explorer support is shown at the bottom of the page you linked above or at [email protected] and it's them you should be asking really.
    You should be keeping iTunes and the iPad software always up to date for security reasons.   If that breaks external software then they are the ones to ask.
    If you are having problems with the iPad then try resetting it by clicking the Home and Sleep buttons simultaneously for about 10 seconds until the Apple logo appears.  You wont lose anything.
    If iTunes is acting up then try asking on that forum:  https://discussions.apple.com/community/itunes/itunes_for_windows

  • After the recent update on my Ipad Mini. It crashes frequently. The latest is that during saving, it crashed. Now I can't open my project file. It says, Not a valid Adobe Photoshop Touch file. What happened?!!

    After the recent update on my Ipad Mini. It crashes frequently. The latest is that during saving, it crashed. Now I can't open my project file. It says, Not a valid Adobe Photoshop Touch file. What happened?!!

    Sufficient free storage.... tried the reboot and install... Just received an iOS update I'll install tonight and do another reboot...see what happens. Going to have to start saving double..

  • How stop File Browse item losing value when a validation occurs

    G'Day Apex gurus,
    I am using Apex 3.1.0 and Firefox in an XP PC and have a file browse page item on my page but whenever i experience a validation error on the page, the value entered into this box is lost.
    Every other field on the page retains its entered value, but the file browser item loses its value.
    This is frustrating because the user will have to reselect the file.
    Is there a way to retain the value upon a validation error?
    I appreciate any assistance with this
    Carlos

    Hey creyes,
    I don't think this is possible.
    Because of security implications (scripts setting the value, and then attempting to retrieve files of your computer) the value of the fileupload form field is read only. Therefore you cannot set, or reset the value.
    A solution could be that you make validations with javascript if possible (but keep validations on the database side also!).
    Kind regards,
    Oli

  • File Browse Item and validation

    Hello
    I have a page with multiple items and validations.
    One of the items is "File Browse..."
    When I select a file on my computer and submit the page, a new record is created in "APEX_APPLICATION_FILES".
    In the page I have a process that saves the blob from "APEX_APPLICATION_FILES" into one of my DB table and then I delete that record.
    That is correct.
    But, if one of my validations is triggered, the record is still created in "APEX_APPLICATION_FILES" and since the validation blocks the execution of my process, the record is not deleted.
    Normally, it should be deleted to prevent the table from taking too much space.
    Is there any DB Job that "cleans" the table?
    Thank you
    Max

    Hi
    I just tough I could do the following validation as the very last one.
    Validation type:
    "Function returning error text"
    Validation Expression:
    begin
       delete from APEX_APPLICATION_FILES
       where name = :P1_MY_BROWSE_ITEM;
       return null;
    end;Condition :
    "Inline validation errors displayed"
    Is there a "cleaner" or better solution I should use ?
    Thanks
    Max

  • File open issue, after file deleted. fopen status is failing in VC++

    /* fopen example */
    #include <stdio.h>
    int _tmain(int argc, _TCHAR* argv[])
      FILE * pFile;
      for(int i=0; i < 1000000; i++)
                bool ret = remove("C:\\abc.txt");
                pFile = fopen ("C:\\abc.txt","w");
                if (pFile!=NULL)
                            fputs ("fopen example",pFile);
                            fclose (pFile);
                else
                            printf("%d fopen() fails \n", count);
      return 0;
    Here, after remove is called, pFile = fopen ("C:\\abc.txt","w");is called,
    Sometimes even in C:\ the abc.txt file is not present after remove called, but the fopen pFile pointer is null.
    This is reproduced some times not always. In this example this issue is reproduced 50/60 times.
    Please suggest some solution.

    Hi,
    Please post in following development forum about VC++ issue:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral
    Alex Zhao
    TechNet Community Support

  • After Effects Error: rendering error while writing to file...Output Module failed - 1610153646

    Hi – I’m currently working with someone who is running After Effects 5.5v10.5.0.253 on a PC which is running Windows 7 Ultimate. The computer has just recently been built and the software is newly installed. (ie. a couple of weeks old, max). Up until now, we have been using After Effects with no real issues. But tonight, we started to see the following error message, when trying to render something out:
    “After Effects Error: rendering error while writing to file xxxxx. Output Module failed, the file may be damaged or corrupted -1610153646” – displayed during render, which meant the render failed.”
    We started to review forums to see if we could come up with a fix and tried a few of the more common suggested solutions, including:
    Make sure there are no third-party plug-ins or Windows incompatible elements installed - as it’s a pretty new install, we haven’t added anything except out-of-the box elements.
    Clear the render queue – did this, no change.
    Reinstall Quicktime – did this, no change.
    Reinstall Creative Suite – also no change.
    Check the default program to open .mov files is Quicktime – Quicktime was already the default.
    A bit more detail about the machine...
    Ram is 32gb
    GPU is GeForce GTX 660ti
    250gb soild states
    2tb raid drive
    Any help would be much appreciated. This is now happening on all AE files, even files that worked fine earlier in the week. Other than the AE and QT reinstalls mentioned above, nothing new has been added to the machine this week. On a deadline – so a quick response would be amazing, right about now. Thanks.

    Hi Mylenium- thx for the quick response. We have have tried a bunch of different settings. AVIs work and we can do image sequences too. The only major problem seems to be with Quicktime files. While I appreciate your suggetion to convert with AME - this is only a workaround. Was really hoping for a solution that will fix the problem in After Effects? Heard rumor from a few friends in the biz, that this is a major bug... if possible, some feedback from Adobe product devs or someone with a technical background would be great! Thx.

  • Macos file upload file browse has started suddenly to close after a few seconds before allowing me to choose a file

    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
    A couple of days ago after the latest update every time I try and upload a file to a web site the file browse has started suddenly to close after a few seconds before allowing me to choose a file.

    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
    A couple of days ago after the latest update every time I try and upload a file to a web site the file browse has started suddenly to close after a few seconds before allowing me to choose a file.

  • Empty file format in BSP after upgrade of PL48

    Hi,
    I upgraded our SAP B1 2007A to PL48. BTHF Addon and Payment Engine Addon are running.
    Under Bank->...> Import external bank statements I already used the import function with the PL47.
    Now when I would like to import a new bank file I get the following error in the status bar:"File format is empty"
    I get this message only on the Win XP workstations, if I start the SAP client on our Windows Server it works fine. No error message and the import function is also working.
    I already reinstalled the client, tried on two other workstations, found the note 1325121 also, which tells to reassign the bank format file. But no success.
    Any idea?
    Regards,
    Zsolt

    Hi,
    I checked. It is basically the same to do list in both notes.
    From the workstation I uploaded the Bank format file once again. Then I also downloaded the file, and opened with the Format definition addon to check it. Everything is correct. The file is not empty, and it is working well within the Format definition addon. You process the bank file.
    Then I would like to import a file in BSP, and I got the same error: Format file is empty.
    With the PL47 we made at least 20pcs BSP file import, it was working well. We made the PL48 upgrade on our server, then we processed the automatic client update.
    If you run the SAP client on the server the BSP is functioning well, but none of the workstations are OK.
    Dotnet problem ?
    Regards,
    Zsolt

  • File Browse Item in APEX versions prior 4

    Hi there,
    we are currently struggling with a strange issue concerning the File Browse Item in earlier APEX versions: The item value is not submitted correctly when using APEX Listener. There is always a F<randomnumber>/ as prefix that is not visible anywhere in the page source code (so it's not generated by APEX itself) or browser (Firebug trace didn't see any prefix transmitted) and this value is even there when the file browse dialogue is submitted empty. The latter case causes severe problems, as validations fail to detect null values. Our current workaround is a regex on that prefix, but this obviously is no clean solution.
    We found out that F<randomnumber>/ is the prefix of the name that is created temporarily in WWV_FLOW_FILES. If submitted correctly, the name is prefix + actual filename.
    This problem does not occur when using OHS and it does not occur when running the APEX Listener on top of APEX 4.0.2.
    The problem occurs reproducible in the following environments:
    - APEX Listener 1.1.2 standalone or any JEE Container, JDK 1.6.0_26, Linux or Windows
    - APEX 3.1.2 or APEX 3.2.1
    The problem seems to be related to the one discussed in {thread:id=2205973}, but describes some different effect that is not reproducible on OHS.
    I appreciate every clue where this may come from and any hint on how to turn it off...
    Thanks,
    Udo

    Hello Claudio,
    After reading this story, I have same problem with version 1.1 of the apex listener and version 4.1 application express.I still think it affects only versions prior to 4.0. I'm not able to reproduce it on 4.1.
    How do I resolve this problem?I think you ran into a bug in GlassFish 3.1.2. This has been discussed and resolved here: {thread:id=2357381}
    I hope this helps you solve your problem.
    -Udo
    P.S.: Please always open a new thread if you are not sure you are in the same situation and especially when the original thread is long "dead" like this one. Of course you can reference other threads with possibly similar issues in your thread.
    Thanks!

Maybe you are looking for

  • SOUND for Macbook Pro to emerson TV! HELP

    I just recieved an Emerson HDTV and am trying to connect it to my Macbook Pro.  By using an HDMI2 cable, I have picture.  But, I cannot get the sound.  I have plugged in an audio cable (don't know the name of it but it is the type that fits into the

  • Wily Introscope 8.2.2 - No License for Wrapper service

    Hi All, I've installed the Wily Introscope Manager 8.2.2. When starting the EM service, I get the following error message in the log file: STATUS | wrapper  | 2010/09/20 15:10:47 | --> Wrapper Started as Service STATUS | wrapper  | 2010/09/20 15:10:4

  • Neo2 Problem: Multiple HDs are seen as the same connection

    Ok, I'm just checking to see if this is indeed a problem Windows recognizes my 2 sata drives and 1 IDE drive all under the same device 0. When I try to install XP sp2, all the options on the screen show the same device #0. I believe this also corrupt

  • Problems by installing the latest version of the flash player

    I cannot download the newest version of the flash player!!!!!! I have already tried several times but it always went wrong.... I have already a version but the system ask to download the latest version. Now I cannot watch all the  filmpjes which are

  • Does CC allows the saving of .psd or.indd in lower versions than CS6 ? (just like Illustrator-)

    If I can't save my files in lower versions than CS6, my clients and printers will HAVE to update to CC too, though they don't need this up to date versions to work. For example saving a file from InDesign CS5 in order to open it with CS3 is a real ch