Different issues with file browse item

Hi everybody,
I'm trying to create a file upload page using the file browse item. To achieve this I followed the how-to document :
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b16376/up_dn_files.htm.
I've created my own table to store the documents as I store some extra information.
When I test this functionality I discovered many issues.
- If I upload a PDF file this gives me HTTP 404. When I go back, choose the same file with the browse button and upload again this will pass.
- If I upload a file with spaces in it's name this file will be uploaded twice. (I see the same file two times in the table with 2 different names.
- At random times I will just arrive at a blank page after clicking the upload button. It appears to me as this will happen more often when I use a double-click to select the file in the browser dialog compared to selecting the file and clicking open. However, I suppose this is just coincidence. It happens in both cases. I'm confronted with the problem with small files (1k, 4k) as well as with larger files (6m)
- Like I said before, I store some extra information as well. In some cases this information is stored with the document. In some other cases he takes the description from a previous document to store along with the new document. I suppose this is some kind of session problem probably caused by the other problems I currently have and the fact I press back quite often in my browser (each time I arrive at a blank page)
Version of HTML DB 2.1.0.00.05
(Included with Oracle 10g express edition)
I read several posts on this forum before creating my own thread.
-> I found several discussions about the size of the file but the problem exists for files of 1K as well so I don't see a link with those discussions.
-> I found several discussions about security and tablespace quota. I granted unlimited tablespace to each and every user : flows_020000, flows_020100, flows_files, htmldb_public_user and the user who is used in the application.
Tx very much for your help!
Kris

Hi Kris,
I think you're problem is coming from local session info... using the back button is not that good. Put a back button in your application ;-)
An other thing I wonder is; are you developing and testing on the same machine and at the same time? - I did that before and that gave me some problems. Now I'm developing in Firefox and test with IE or vice-versa.
Dimitri

Similar Messages

  • 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

  • Htmldb page with 'File Browse' hang on submit change

    I have a htmldb page with 'File Browse' item. With File Browse empty, on pressing submit button with which has 'SQL UPDATE' action and returning to same page branch, the page hangs.
    It also happen on File Import page of htmldb application itself with File Browse.
    Anyone have the same problem or know why?

    I'm working with Sashisu on our problem and I wanted to give a few more details on what we've found.
    -We're using HTMLDB 1.6
    -The problem occurs only on pages with a file upload page item.
    -When clicking a link on one of the problem pages the browser will stick on retrieving the page for 1-2 minutes, then ultimately it will end in a page cannot be displayed error.
    -Sometimes the page will not hang and go directly to the page cannot be displayed error.
    -After encountering the error, clicking back to return to the page and then retrying the link will successfully load (and upload the file) the next page.
    -The problem only happens in IE 6.0. The submits work fine in FireFox.
    -Our development servers do not have this problem using the same HTMLDB code. The configuration between the servers on Development and Production is similar but not exact (we're working on finding the delta).
    -We did not have this problem on production until a recent code update.
    Thanks in advance,
    -John

  • Modifying File Browse item through Javascript

    I would like to modify the value of a File Browse item with javascript in my Submit button under certain circumstances. I would like to remove the file name (and path) from the File Browse field, so that the file is not automatically uploaded when the Submit button is pressed. It would seem I could "null" out the filename within the javascript function and then follow that with doSubmit ('SUBMIT'). The rest of the page values would be posted to the database, but the file would not get loaded. However, I cannot figure out how to access and modify the filename in the File Browse field with javascript. I've tried using ".value" and ".src" but to no avail. Saw a thread that says there is a bug with File Browse items in versions earlier that 2.2 (I'm using 2.0), and that you needed to fall back on the "p_t xx" notation, but I can't find any information on what that is. Appreciate any help.

    I apologize for the multiple threads. The response to my initial inquiry on thread Inserting/uploading data without inserting/uploading a document was that "others" would be better equipped to help me than the initial responder, so I didn't think I was supposed to continue with that thread. (Haven't used this forum much.) I found a second thread (the one with the "p_tXX" notation, and responded to it, but wasn't sure if all older threads were still active, so I also iniitiated a thread on my own.
    In response to the inquiry about why not using an after submit computation to null out the File Browse item, what I am trying to prevent is the uploading of a file to the WWV_FLOW_FILE_OBJECT$ table, if there is an entry in my File Browse item, when all the user really wants to do is update some data items on the main portion of the page. I have a Apply Changes button on the main data entry form, and then I also have (at my user's request) a separate form and Submit button on the page where the user may enter a file name to upload. The trouble exists when the user is only trying to modify data in the main form, but has also left an entry in the File Browse item. When the page is submitted, the data is uploaded OK, but the file is also uploaded via HTMLDB_APPLICATION_FILES, since there is an entry in the File Browse item. What I'm trying to do, is clear that File Browse item out when the user presses the main form Apply Changes button, so that the file does not get uploaded. The users want the ability to upload a file, but only when that is their direct intent. Obviously, I do not want to clear out the File Browse item under those circumstances. Hope this is clear; sometimes difficult to satisfy the users needs (whims?). Appreciate any help.

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

  • 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

  • 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

  • Maybe enhancement request: File Browse item with Button in template style.

    When I use a file browse item on a page it gets a standard HTML button. This looks a bit out of place among all the other template style buttons.
    Is there a way to give the file browse button a template button style?

    Hi Rene,
    there is a nice workaround available.
    You just need to create some css changes:
    /* this one hides the original button + field */
    input.file {
         position: relative;
         text-align: right;
         -moz-opacity:0 ;
         filter:alpha(opacity: 0);
         opacity: 0;
         z-index: 2;
    }Now you have to choose which solution you like most:
    http://www.quirksmode.org/dom/inputfile.html
    http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom
    Seems like a nice plug-in solution. :)

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

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

  • How to know if a file browser item is not null using javascript fucntion

    Hi
    <br><br>
    I tried to use javascript for validation. I have a file browser item named P55_FILE_NAME and I would like to know if this item is null or not before submit.
    <br>
    I wrote this function :<br><br>
    function validate_import(f_n){<br>
         if (trim(document.getElementByName(f_n).src) == "")<br>
         {<br>
         alert ("File name is empty.");<br>
         document.getElementByName(f_n).focus();<br>
         }<br>
         else{<br>
         doSubmit('SUBMIT');<br>
         }<br>
    } <br><br>
    When I press submit button I got an error, sounds like the src method does not exist in my input item. <br>
    Then, I looked my source page an I found this :<br><br>
    input type="file" name="p_t01" size="30"
    <br><br>
    there is know src method and the name is not P55_FILE_NAME and I don't want to use <b>p_t01</b> that will change.<br>
    <br>
    I need your help.<br>
    Benn

    Hello,
    The p_txx notation is the internal name the ApEx engine attaches to each page item. It starts with p_t01 (for the first item on page) and can end with p_t99 (hence, the max 99 items per page limit). You can see these names in your HTML source code.
    The bug in the File Browse item (fixed in version 2.2) is that the ID of the item is the internal name instead of the item name. Hence, in order to use DOM, you need to use this internal notation.
    If the File Browse item id is p_t01, you can null its content by using something like that (V2.0 notation) :
    html_GetElement('p_t01').value = '';I'm using the same, and similar code, for manipulating this type of item with no problems.
    Please document the use of this workaround, as when you'll upgrade your ApEx system, you will have to change this code back to the standard – item id equal item name.
    (Please follow Scott's advise, and keep your logic connected issues on the same thread. It will get you more quick and accurate help).
    Regards,
    Arie.

  • 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

  • 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

  • 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

Maybe you are looking for

  • Manual for Macusers

    I have just bought Elements 12. I am a Mac user (iMac and Macbook) and I am searching for a manual Photoshop Elements 12 specially for the Mac. Elements 12 for the Mac has no Dutch version, so I have the English version. I have a manual but that is m

  • Changing the account number through DTW.

    Hello All, wheather Its possible to replace the existing G/L account through DTW. For example, Inventory account is '1021000'(Raw materials) in Inventory data tab in Item Master data. But I want to replace it to '1021201'(Industrial Stock account). P

  • Why can't i update my iPhone4S to iOS 6.1? error 3194

    im running 6.0.1 and cant update to 6.1. i have tried everything i can think of, but i get the error 3194. Why?! help please

  • Quality Refresh

    HI Gurus,      I am taking online + redolog backup of my production system and offline backup of Quality system. Now I am going to do the quality refresh by restoring the backup of production system into Quality system. Our backup is taken using Tivo

  • FRA filling up

    10.2.0.2 on Solaris We have a backup area of 600 GB, and a database that is about 150 GB. We take nightly backups like this: recover copy of database with tag 'INC_BKUP'; backup incremental level 1 copies=1 for recover of copy with tag 'INC_BKUP' dat