APEX File Browser ITEM - select only XML Files

HI ALL,
I have problem with File Browser Item.
How to I use file browser item select only xmlfile (*.xml)?
Edited by: Mahir M. Quluzade on Nov 29, 2010 2:33 PM

Try using the attribute<tt>accept</tt> attribute using the item's HTML Form Element Attributes:
accept="text/xml"but note the warnings about poor browser support.

Similar Messages

  • Resetting the File browse item in Javascript in Apex 4.0

    Hi,
    Can anyone please help to reset the File browse item in Apex with Javascript.
    For example I have an File Browse item P10_FILE_BROWSE, I have selected some file in it and on Click of button, I want to set NULL in that File Browse item "P10_FILE_BROWSE"
    I have tried below options but none of them is working for IE 7
    $x('P10_FILE_BROWSE').value = null;
    $x_Value('P10_FILE_BROWSE',null);
    $s('P10_FILE_BROWSE',null);
    document.getElementById('P10_FILE_BROWSE').value = null;
    document.getElementById('P10_FILE_BROWSE').value="";
    document.getElementById('P10_FILE_BROWSE').reset();
    Please help at earliest.
    -Pramila

    For security and privacy, file browse item values cannot be set using JavaScript.
    Think about it: my page displays a file browse item, the user selects a file, then when the submit button is clicked, my JS code changes the value of the file browser to <tt>/etc/passwd</tt>. Not good.
    (Please update your forum profile with a real handle instead of "user12879893".)

  • 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!

  • Open Cursor Issue because of file browse Item - Is this a Bug in APEX 3.2

    Hi All,
    I am using file browse Item to upload file into the database at two places in my application, but it seems whenever I am submitting those two pages, with file path or without file path, its opening an cursor which remains open after that, because of this open cursor count in the application is getting exceeding every time.
    For testing this I have made an dummy page containing just file browse item and submit button, and still it is increasing the open cursor count.
    Is this a bug in Apex file browse item or there is some other way to handle this.
    Please kindly help me in the above issue as this is affecting the production application.
    Thanks & Regards
    Sanjay
    Edited by: user11204334 on Dec 5, 2010 9:57 PM
    Edited by: user11204334 on Dec 5, 2010 9:58 PM

    Hi,
    One observation, Apex is switching the Session ID after one got killed ? I was working on Apex page with browse Item to test open cursor count,
    after killing the SID (227) on which the open cursor count was getting increase, it APEX automatically switches to new SID(149) for that session.
    Now the problem is even if I have two SID's and one hits the maximum open cursor count, It is not switching to other SID instead the whole application becomes unavailable.
    STATNAME SID VALUE USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 74 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 227 325 APEX_PUBLIC_USER Killed
    opened cursors current 244 15 APEX_PUBLIC_USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 76 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 244 15 APEX_PUBLIC_USER
    Please kindly help in this.
    Thanks in Advance
    Thanks & Regards
    Sanjay
    Edited by: user11204334 on Dec 8, 2010 1:02 AM

  • Using  File Browse Item To Get File Only

    Is it possible to use the file browse item to just get the file without inserting it anywhere?
    I'm looking to allow a user to "upload" a file from their client machine... but what will actually happen in the process is it will take the file and send it in an e-mail to whomever needs to get it.
    Or is the only way to allow it to insert the file, do what I need to do with it, and then immediately delete it?
    Thanks,
    Chad

    Hello Chad,
    Please check if the following can help you - Using the file browser. .
    Regards,
    Arie.

  • APEX 2.2 - File Browse item maximum file length?

    Hi all,
    There seems to be a maximum length for file name (not path - just the name) that can go into APEX through the File Browse item. I have a file name that is 206 characters long. Even if I put the file in the root directory, when I try to upload it to my APEX application, I get a 404.
    What is the maximum file name length?
    Not relatedly, IE6 balks when the file path length exceeds a certain amount. It doesn't attach the file to the file input HTML element. Does anyone happen to know what that length is?
    Thanks!

    Don - See Re: Upload File with filename greater 80 characters -> HTTP 404 File not fo for related info.
    Scott

  • How to populate DB column with filename from file browse item?

    Hi,
    Using APEX 3.1.2, I'm trying to easily allow maintenance of a filename stored in a DB column (VARCHAR2(1000)). Using the column as a file browse item seemed to be the way to go, but of course I don't want the resulting file to be uploaded and it appears as though an existing filename is not shown in a form when the row is retrieved.
    After much searching, I found Checking filename length in File Browse item before uploading , but I'm not able to connect the dots. I was thinking that I could create a hidden file browse item and use a button to call Javascript function to activate it, then save the resulting filename to my DB column item and wipe out the hidden item before it was uploaded. But the hidden item doesn't appear, so I'm not able to reference it's form input name.
    Hopefully this mess makes sense. Anyone?
    Thanks!
    Rich
    Edited by: socpres on Sep 5, 2008 2:02 PM because message was truncated after attempting to preview it first.

    Hi John,
    From what I can tell, the path of a local file browsed from a file browse item cannot be retrieved because of security concerns. Although, it seems that while Firefox 3 only returns the filename sans directory, IE6 returns the full path:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
    <head><title>Form Test</title>
    </head><body>
    <script type="text/javascript" language="JavaScript">
    function GetDirectory()
    strFile = document.FileForm.filename.value;
    intPos = strFile.lastIndexOf("\\");
    strDirectory = strFile.substring(0, intPos);
    alert(strDirectory);
    document.FileForm.Directory.value = strDirectory;
    </script>
    <form id="FileForm" name="FileForm">
    <input type="file" id="filename" name="filename" value="" onChange="GetDirectory(this.value)">
    <input type="hidden" id="Directory" name="Directory" value="">
    </form>
    </body>
    </html>
    This Win-specific code displays the path via IE6, but not in Firefox 3. Then again, I can't seem to preview posts here using FF3, either...
    Rich

  • How to set "Files of type" when using a "File Browse" item.

    Apex 4.0.2
    Internet Explorer 7 +
    I have a "File Browse" item on a page and need to limit the types of files display to just "text (.txt)" files. How can this be done? Currently, the "Files of type" list shows "All File (*.*)", "Pictures (*.gif,*.png)", and HTML (*.htm,*.html)". In the best case, I would like to not have the "Files of type" list and have the user just limited to text files. However, adding Text files (*.txt)" to the "Files of type" list is ok.
    thanks,
    William

    Thought i'd do a bit of research after seeing Scotts wonderful ideas.
    So it turns out, IE made the file item read only from version 8, for security reasons. Read more: http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
    File Upload Control
    Historically, the HTML File Upload Control (<input type=file>) has been the source of a significant number of information disclosure vulnerabilities. To resolve these issues, two changes were made to the behavior of the control.
    To block attacks that rely on “stealing” keystrokes to surreptitiously trick the user into typing a local file path into the control, the File Path edit box is now read-only. The user must explicitly select a file for upload using the File Browse dialog.
    Additionally, the “Include local directory path when uploading files” URLAction has been set to "Disable" for the Internet Zone. This change prevents leakage of potentially sensitive local file-system information to the Internet. For instance, rather than submitting the full path C:\users\ericlaw\documents\secret\image.png, Internet Explorer 8 will now submit only the filename image.png.To resetting the actual items, suggestions I found were to replace the actual item. So instead of using $s, I just replace the element, with the existing element, causing it to re-initialise.
    var htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    function fileCheck(el){
        if(el.value){
            var validFile = false;
            var validExtensions = ["csv"];
            var filename = el.value;
            var fileExtIndex = filename.lastIndexOf(".");
            var fileExt = filename.substring(fileExtIndex+1, filename.length);
            for(i = 0; i < validExtensions.length; i++){
                if(validExtensions[i] == fileExt){
                    validFile = true;
                    break;
            if ( !validFile || fileExtIndex == -1) {
                alert("Invalid Extension. Permitted files must end with: " + validExtensions.toString());
                var htmlContents = el.outerHTML || new XMLSerializer().serializeToString(el);
                $('#P16_BINARY').replaceWith(htmlContents);
    }(obviously, replacing what you need to, to suit your page - i prefer scotts idea of passing in supported file types in the function, so would just pass in an array instead; but this is just for demonstration)
    with an onchange="checkFile(this)" on the element attributes.
    On a slightly un-related note, I found out IE doesn't support the wonderful indexOf function on arrays, that checks for the existence of the value in an array. Sucks.
    Edited by: trent
    Ah well, jQuery is there, maybe i should use that for searching arrays in the future.
    http://api.jquery.com/jQuery.inArray/
    Edited by: trent
    Forgot a demo link, for csv files: http://apex.oracle.com/pls/apex/f?p=45448:16
    Edited by: trent
    Modify function. Didn't work in Firefox

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

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

  • File Browse Item questions..

    Hi all..
    Please help me with these questions on ""file_browse"" item.
    I have a file browse item on a page, like in the following app.
    http://apex.oracle.com/pls/apex/f?p=62812:1
    1) when the user select a file with the browse button,we will get the
    """file path""" in the text field.
    Is it possible to validate (via javascript or any other way), whether that particular
    ""file path"" is correct and a valid file exist as per the ""file path""??The reason for this validation is, sometime our users will copy the ""file path"" instead of using the
    file browse button.
    2) http://apex.oracle.com/pls/apex/f?p=62812:1
    If users enter a valid path, but on that particular page if i have any validations,
    If any of the validations fails, it is clearing of the ""file path"" that the user entered.
    Is it possible to retain the ""file_path"" that the users entered? even if any validations fail?EX: In the following page
    http://apex.oracle.com/pls/apex/f?p=62812:1
    Please
    i)select a valid file from the ""file browse"" item and
    ii)""dont select any select list "" value
    iii) click upload.
    validation will get fired and file path get cleared.
    Thanks

    kumar wrote:
    Thanks for the reply fac...
    fac..just curious to know, what security issue do any one get , if file browse item keeps the ""file path"" they previously selected..The issue is not the server keeping the file "previously selected", but maliciously changing the value to capture a file the user does not intend to submit (e.g /etc/passwd) when the invalid page is resubmitted.
    so every time, when some validation fails, ""user need to reselect that file"".??For their own safety, yes.
    even it is in session state.. for a common user,he feels that it got cleared out and need to ""reselet "" the file again..It's a good practice to clean up any submitted files in APEX_APPLICATION_FILES should any related validations fail.
    Is there any other alternative for this issue? or It is (file browse item) just how it behaves?To ensure a secure and safe web environment it's how it's got to behave.
    Good UI design can be used to minimize the impact on users by isolating file browse items on different pages to items that are prone to validation failure, through the use of multi-page wizards etc.

  • Problem with file browse item

    Hello,
    I use a file browse item with storage type WWV_FLOW_ITEMS, but when I select a file, it never appears in WWV_FLOW_ITEMS.
    In an earlier version of apex I had it working fine, but now nothing happens.
    What am I missing?
    We use apex v4.0.2 and a standalone apex-listener v1.1.2.
    Any help would be greatly appreciated.
    Thank you,
    Jos

    user477344 wrote:
    Thanks VC,
    But since I remain in my application to query wwv_flow_files once the file is in wwv_flow_file_objects$, how come I don't get a reply?
    The workspace is still current, not?
    Josquery the table wwv_flow_file_objects$ and make sure the value in SECURITY_GROUP_ID column matched with your current workspace ID

  • Multiple file browse items on a page

    Hi,
    A relative newbie so apologies if this has already been answered...
    Is there a way to add an arbitrary number of "File Browse" items to a page and then programtically go through them and upload the files specified?
    So a user, for example, goes to a screen and by default can upload 3 files however they have 5 files to upload. What I would like them to be able to do is instead of having to upload 3 files followed by another 2 files they could add two more boxes to upload files.
    To complicate things slightly more I'd also like each File Browse box to have an associated additional field that is a file description.
    Best regards,
    Gareth.

    No problem I've been trying out a few ideas and have a workable solution - although there is one thing that bugs me/I don't fully understand.
    In the page I have created the user clicks 'Add' to add the file to the collection which it does successfully. However this also causes the file to immediately be uploaded to APEX_APPLICATION_FILES.
    Is there a way to prevent this behaviour? Ideally no files would be uploaded until an overall page submit occurs. i.e. The only thing that changes until the page level submit is pressed is the Apex collection. Once the submit is pressed the process loops through the collection uploading each file.
    If this isn't possible then I can work around it I think by allowing the users to update the collection and delete individual members which in turn would delete the file from the APEX_APPLICATION_FILES view.
    I suspect that the upload logic is somehow wrapped up in the "File Browse" item so it's not possible to do it in the way I imagine but thought I'd ask anyway.
    Thanks again for your help.
    Gareth.

  • How to get full path in file browse item

    Hi
    I have a file item. When I submit the form and store and value in db, then the file path is stored as numbers and appended to the file name. I undestand that this is because of some wwv flow files index or something . How to get the file path? Anybody...

    For security/privacy reasons recent versions of browsers by default do not send local file path information from File Browse items to the server, nor expose the file path in the control's JavaScript methods. Firefox, Safari and Chrome only provide the filename. IE6 & IE7 still yield the path in Windows format. IE8 and Opera have adopted an irritating approach of replacing the path with a wholly imaginary "C:\fakepath\".
    Changes to IE's security config can enable the path to be exposed in IE8, but I don't think it will be available via <tt>apex_application_files</tt>.
    For more information see:
    http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/018980.html
    http://blogs.msdn.com/ie/archive/2009/03/20/rtm-platform-changes.aspx

Maybe you are looking for