File Browse item...

Hi everyone,
I need a help...I'm sure it's a piece of cake for most of you...but.
First of all I must explaine a architecture of the our application.
So, we have a APEX and application which is placed on Server_01 and the data which are on Server_02. Databases are connected with a database link.
Well, in the apllication I use the item "File Browse" to get some file from the hard disk of local computer.
By default the file is saved in wwv_flows_files ( view on table wwv_flow_file_objects$ ).
I need to insert that file on the remote database ( Server_02 ) over database link in the BLOB datatype field.
...so, if someone have any solution or experience...
thanks,
Mzz

Zlatko,
If you follow the instructions in our primary how-to on this topic, specifically the part "Storing the Document in a Custom Table", I think you need to change the code just a bit to insert the row (with the blob) into the remote table over your database link (http://download-west.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CIHHEHCJ).
Scott

Similar Messages

  • 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

  • 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

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

  • 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

  • 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

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

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

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

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

    Hello all,
    I would like to ask if is possible to translate the "Browse..." button of File Browse item.
    For me it seems that the button cannot be translated to a different language. I have tried to export the XLIFF and there is no string like "Browse...", also I have tried to edit it manually in translation repository, but the string is not present here.
    Any ideas?
    -Jiri

    I think it is decided by the browser itself according to the browser lang
    See
    http://stackoverflow.com/questions/1163667/how-to-rename-html-browse-button

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

Maybe you are looking for