Issue with Getting the file path from InputFile component

Hi,
One of our requirement is like below:
I am working on ADF 11g (latest release R1) page. User will select the file and when he/she clicks on the Save button we need to store the file path in the database.
In the database file_path is varchar2(300). We need to store just the file path. I am using InputFile component but filepath is not getting inserted.
This is really urgent. It would be really appreciate if anyone can guide me on this.
Thanks
MC

Hi Mahesh,
I have manage to store the file path from the InputFile component in Jdev 11g. I found the file upload script from this forum and manage to alter it so that i could save the file path to the database. But my problem is to retrieve it back to view as a document. Hope this will help you :)
This is an example of what I have manage to save to my DB :
(CLOB) //192.168.238.53/c$/Research/Docs/0906160744/EyeCandyLog.txt
In my form, I save the file path first before I update the other fields. My code is something like this :
public void uploadFile(ValueChangeEvent valueChangeEvent) {
// Add event code here...
InputStream in;
FileOutputStream out;
if(tanda == 0){
try {
// final Context context = getInitialContext();
RS01Proposal rS01Proposal = (RS01Proposal)new InitialContext().lookup("Phase2-RS01Proposal#sr.model.RS01Proposal");
id = rS01Proposal.dptProposalid();
tanda = tanda + 1;
System.out.println("tanda"+ tanda);
} catch (Exception ex) {
ex.printStackTrace();
System.out.println("id"+id);
proposal = id.substring(6);
System.out.println("proposal"+proposal);
UploadedFile file = (UploadedFile)valueChangeEvent.getNewValue();
String fileUploadLoc = "//192.168.238.53/c$/Research/Docs/"+id+"/";//The place where file will saved
//create upload directory
boolean exists = (new File(fileUploadLoc)).exists();
if (!exists) {
(new File(fileUploadLoc)).mkdirs();
if (file != null && file.getLength() > 0) {
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage message =
new FacesMessage("File Uploaded " + file.getFilename() +
" (" + file.getLength() + " bytes)");
*// extracting the file message to get the path*
context.addMessage(valueChangeEvent.getComponent().getClientId(context), message);
columnL = valueChangeEvent.getComponent().getClientId(context);
column = columnL.substring(9);
System.out.println(column);
columnLengkap = "RS01"+column.toUpperCase();
System.out.println("columnLengkap"+columnLengkap);
*try {*
out = new FileOutputStream(fileUploadLoc + "" + file.getFilename());
in = file.getInputStream();
*for (int bytes = 0; bytes < file.getLength(); bytes++) {*
out.write(in.read());
in.close();
out.close();
} catch (IOException e) {
e.printStackTrace();
} else {
String filename = file != null ? file.getFilename() : null;
String byteLength = file != null ? "" + file.getLength() : "0";
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage message =
new FacesMessage(FacesMessage.SEVERITY_WARN, " " + " " +
filename + " (" + byteLength + " bytes)",
null);
context.addMessage(valueChangeEvent.getComponent().getClientId(context),
message);
System.out.println(fileUploadLoc+file.getFilename());
a = fileUploadLoc+file.getFilename();
b = b + 1;
if (flagInsert == 0){
try {
// final Context context = getInitialContext();
RS01Proposal rS01Proposal = (RS01Proposal)new InitialContext().lookup("Phase2-RS01Proposal#sr.model.RS01Proposal");
rS01Proposal.insertDoc(id,proposal,columnLengkap,a);
flagInsert = flagInsert + 1;
System.out.println("tanda"+ tanda);
//session
ProposalSession.storeCurrentProposalId(id);
} catch (Exception ex) {
ex.printStackTrace();
}else{
// update proses
try {
// final Context context = getInitialContext();
RS01Proposal rS01Proposal = (RS01Proposal)new InitialContext().lookup("Phase2-RS01Proposal#sr.model.RS01Proposal");
rS01Proposal.updateDoc(id,proposal,columnLengkap,a);
flagInsert = flagInsert + 1;
//session
ProposalSession.storeCurrentProposalId(id);
System.out.println("tanda"+ tanda);
} catch (Exception ex) {
ex.printStackTrace();
}

Similar Messages

  • How to get the file path from HTML input form in Firefox 3...

    In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like 'C:\folder1\folder2\folder3\filename' it works properly and gives the full path to the file and the filename.
    In Firefox 3, it returns only 'filename', because of their new 'security feature' to truncate the path, as explained in Firefox bug tracking system (https://bugzilla.mozilla.org/show_bug.cgi?id=143220)
    I have no clue how to overcome this 'new feature' because it causes all upload forms in my webapp to stop working on Firefox 3.
    Can anyone help to find a single solution to get the file path both on Firefox 3 and IE7?
    Thanks in advance....

    As you're posting this in the JSF forum and looking at your [previous topic|http://forums.sun.com/thread.jspa?threadID=5342365], I assume that you're using Tomahawk's t:inputFileUpload. In this case, just use UploadedFile#getInputStream(). You may find this article useful: [http://balusc.blogspot.com/2008/02/uploading-files-with-jsf.html].
    By the way, are you lazy or just dumb? You wasted one week to this! I've posted the aforementioned article one week ago. How did you stuck?

  • How to get the file path from HTML input form in Firefox3

    In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like 'C:\folder1\folder2\folder3\filename' it works properly and gives the full path to the file and the filename.
    In Firefox 3, it returns only 'filename', because of their new 'security feature' to truncate the path, as explained in Firefox bug tracking system (https://bugzilla.mozilla.org/show_bug.cgi?id=143220)
    I have no clue how to overcome this 'new feature'.
    Can anyone help to find a single solution to get the file path both on Firefox 3 and IE7?
    Thanks in advance....

    Doubleposted and ignored any previous answer: [http://forums.sun.com/thread.jspa?threadID=5342405]. Don't do that. It's rude.
    Regarding to your "problem": why do you need the file path?

  • Getting the file path from a File browse button

    Hi,
    I was wondering if there is a way to extract the whole file path (not just the file name) from a file which is selected using a file browse button?
    I am trying to save the file path as text in my database (I don't want to upload the file). I have linked the file browse object to a table field in the database. But when entered in the database, all I get is a series of random characters, followed by the file name. I would like to have the complete file path instead.
    Tom

    Hi thanks
    I've placed the java script into the head of the page, but unsure as to how to change the taget url for my submit button from doSubmit('SUBMIT') to doPrepareAndSubmit('SUBMIT'). In fact I don't actually have a submit button, but a save new record (which performs an SQL INSERT into the database using the values contained in the fields on the page) or a update record buttons instead.
    I'm sorry but my knowledge of java scripts is not very good either.
    How do I do the follwoing?: if your submit button has not any target set its target to url:
    javascript: doPrepareAndSubmit('SUBMIT')
    Cheers, Tom

  • Hi am having issues with getting the list of users from the Active Director

    Hi am having issues with getting the list of users from the Active Directory, can anyone help me with this!

    Hi Jason,
    Try this:
    1.  In Ultiboard select Tools>>Netlist Editor>>Pins, press the Delete button
    2.  Select all nets in the Select the Net to Delete dialog and then press the Delete button.  This will clear all nets in the layout, don't worry all traces, parts are still on the design.
    3.  Go to Multisim and select Transfer>>Forward annotate to Ultiboard.    This will add all nets that you removed back and it should fix the pin problem
    Tien P.
    National Instruments

  • Issue with length of file paths - Windows & C++ plugin

    Hello,
    I've got an issue that just popped up on my OCR plugin I've been working on that I suspect is related to the length of the filepath.
    I'm getting the following error that is being caught and logged when trying to open a file (filename changed for security purposes):
    Error Opening File: D:\aVeryLongFilePath.pdf
    Exception info: This file cannot be found.
    The entire string, including the D:\ part, is 266 characters long. I cut down the length of part of the path one by one and it was able to open and OCR the document when the length was 259 characters.
    I know there's a MAX_PATH variable in Windows and/or there's some kind of limitation for file length. Note that I can open the file in Acrobat using File->Open and run OCR on it individually using the built-in Recognize Text function, but if I try to Recognize Text for Multiple files and choose "Add Folders", the file in question doesn't show up in the list of files to be batch OCR'd (even though it is there). Interestingly, choosing "Add Files" from the Recognize Text->In Multiple Files does work. So Acrobat itself has at least some issues opening the file using some of it's features.
    Here's how I'm opening the document:
         string pn;               // assume this is initialized, I'm just putting this here to demonstrate what type it is
         pathName = pn;
         ASAtom pathType = ASAtomFromString("Cstring");
         asPathName = ASFileSysCreatePathName(ASGetDefaultFileSys(), pathType, pn.c_str(), NULL);    
         pdDoc = PDDocOpen(asPathName, ASGetDefaultFileSys(), NULL, true);
    Is there a way around this problem?
    Thanks.

    Yes, you are hitting the MAX_PATH on certain versions of Windows.   The only workaround would be to see that the file is "a very long path" and then break up the pathname construction into multiple pieces (perhaps the containing directory and then the file itself).  The other option is don't use Cstring to construct, use the Unicode variant.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Mon, 7 Nov 2011 15:43:33 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Issue with length of file paths - Windows &amp; C++ plugin
    Issue with length of file paths - Windows & C++ plugin
    created by zephed56<http://forums.adobe.com/people/zephed56> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4012710#4012710

  • File Adapter - how to get the file count from a folder

    Hi All,
    I have a requirement that have to poll a directory when the file count is reached to number N (ex:number of files avilable in folder is 5) otherwise it should wait and not pick any of the files. Is it possible to get the file count from a folder using file adapter ?? otherwise please suggest me an approach to achieve this requirement.
    Thanks,
    JJ

    Hi Sarath,
    Thank you for your reply.
    Go with the list files operation of file adapter it will gives you the number of files in the specified folder as you given. . - this step is already done.
    When the number of files reaches your count startup your webservice that which can polls the files. . . - how can i acheive this?? Have to poll the directory and process the number files - please let me know, what could be added to the webservice which is being invoked after cheking file count from parent process.
    The reason for the above question is - we cannot use ReadFile operation in second webservice because it will be automatically triggered when the file is avilable. Also SyncRead operation supports reading one file in b/w bpel process. Kindly explain me the implementation steps.
    Thanks,
    JJ

  • Function module to get the file path in the system for TEMP folder

    Hi All,
    Is there any function module that I can use to get the file path in the system for TEMP folder.
    I mean, i am supposed to give only TEMP as the input for that function module and I need to get the path of that in the system as the output.
    I am unsing 4.0 version.
    Please advice.
    Regards
    Ramesh

    In Higher versions, we can use the below code:
    call method CL_GUI_FRONTEND_SERVICES=>ENVIRONMENT_GET_VARIABLE
        exporting
          VARIABLE   = 'TEMP'
        importing
          VALUE      = LV_TMP
        exceptions
          CNTL_ERROR = 1
          others     = 2.
      if SY-SUBRC <> 0.
        message id SY-MSGID type SY-MSGTY number SY-MSGNO
        with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      call method CL_GUI_CFW=>FLUSH
        exceptions
          CNTL_SYSTEM_ERROR = 1
          CNTL_ERROR        = 2
          others            = 3.
      if SY-SUBRC <> 0.
    Error handling
      endif.
      concatenate lv_tmp '\' into folder_path.
    But need to know in the lower versions like 3.1h and 4.0,

  • How to get the FILE COUNT from File directory

    Hello,
    i have to develop a scenario like, get  the file count from source file directory and validate whether the file count is 5 or not. if 5 files exist i need to process those 5 files to DB tables. if file count is not equal to 5 then i need to send a mail to customer that files are missed at source directory. (subject as files were missed at source directory and in content i need to display the file names exist at source file directory. So that missed file will be generated by the customer based on this mail).
    Could you please let me know how to get the count of files from source file directory. if it is possible only with UDF please provide the Java code
    Best Regards,
    SARAN

    Do these files have some fixed names?
    Can you try to use the option Advanced Selection For Source File to make XI  pick all 5 files in one shot?
    Check this blog on the same -
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    If this is not a option - BPM sounds the only possible way.
    Regards,
    Bhavesh

  • To get the File path dynamically

    Hi all,
    I am using the <b>Gui_upload function, and i want to get the file dynamically from the search help</b>,
    So please help me in finding the answer.
    Thanks,
    Girish

    Hai Girish
    Check the following Code
    DATA: I_FILETABLE TYPE FILETABLE,
          V_RC TYPE I.
    PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.     "local file with contracts
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
       EXPORTING
         WINDOW_TITLE            = 'Find File'
         DEFAULT_EXTENSION       = 'C:\'
         DEFAULT_FILENAME        = ''
         FILE_FILTER             = ',..'
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
       WITH_ENCODING           =
      CHANGING
        FILE_TABLE               = I_FILETABLE
        RC                       = V_RC
       USER_ACTION             =
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE I_FILETABLE INTO P_FILE INDEX 1.
    Thanks & Regards
    Sreenivasulu P
    Message was edited by: Sreenivasulu Ponnadi

  • Getting the file type from a placed file

    Hi
    I am trying to get the file type from items placed on a page. I know the types available has one of the three interfaces "IImageAttributes", "IEPSAttributes" or "IPDFAttributes", but how can i test whether the placed image is a TIF, JPG ... Of course i could test on the suffix or the file type (mac), but that isnt "secure" enough, since InDesign can place files with no filetype or extension, if they are in an importable format.
    What I want in short, is to read the filetype shown in the Info palette, any one knows how to do this?
    Jon

    Thanks, I did take a look in these interfaces, but that didnt solve the problem for eps, pdf and other none raster types.
    Instead I found the:
    IDataLink->GetNameInfo()
    Which gives me the string from the Info palette.

  • How to get physical file path from logical file path

    Hi
    there is a immediate requirement ,
    I have logical file path but I need to get physical file path from it.
    So is there any FM which providesthis functionality.
    Points will be rewarded.
    Thanks

    Can you please share the piece of code ?
    Which File APIs are you using ?
    For java file, you can get complete path by simple method call : getAbsolutePath() on file object.
    Regards,
    Ashwani Kr Sharma

  • Issues with getting the slide button to work after upgrade to iOS 7.02 and 7.03

    Ever since upgrading to iOS 7.02 and 7.03 having issues with getting the slide button to work to open up iPad 2.  Happened last week and was able to restore it to new and get it to work again and it worked great until one week later (this morning) doing the same thing.  Have tried restoring iPad to new 3 times (via itunes) and still unable to get the slide button to move so can use the iPad.  IPad able to charge, able to restore, able to sync with itunes even able to recover but not able to get past first screen where you have to slide to access iPad.  Any help would be greatly appeciated.  Live about 300 miles from nearest Apple store.

    I am beginning to wonder whether there isn't some weird problem with that Home button.
    Try this: Settings > General > Accessibility > AssistiveTouch = On
    This will place a button on the iPad's screen.
    You can move this button anywhere on the screen.
    This button gives you - amongst many other things - a soft Home button.
    To turn your iPad on, you can use the Sleep/wake button or move a small magnet across the bezel of the iPad where the volume controls are.
    If you use the magnet, then: Settings > General > Lock / Unlock = On
    Now should not need to press the Home button anymore.
    If this method allows you to use your iPad without a hitch, then suspect hardware problems with the Home button.

  • How to get the file name from Oracle B2B 10g

    Hi My requirement is I am getting a CSV file from Trading partner, I am using oracle 10g b2b to translate the data.
    In my BPEL 10g I am using AQ adapter to get the message from IP_IN_QUEUE.
    Now I want to get the file name Eg: SampleFile.dat of the CSV file in my BPEL process.
    I tried using the b2b.filename property in the receive activity and it is not getting the file name.
    <sequence name="main">
        <receive name="Receive_Note" partnerLink="GetB2BNote"
                 portType="ns1:Dequeue_ptt" operation="Dequeue"
                 variable="Receive_Note_Dequeue_InputVariable"
                 createInstance="yes">
                 <bpelx:property name="b2b.fileName" variable="WriteFileName"/>
        </receive>
      </sequence>
    Can you help me to get the file name from Oracle b2b 10g ?
    Thanks,
    b2b user

    Hi My requirement is I am getting a CSV file from Trading partner, I am using oracle 10g b2b to translate the data.
    In my BPEL 10g I am using AQ adapter to get the message from IP_IN_QUEUE.
    Now I want to get the file name Eg: SampleFile.dat of the CSV file in my BPEL process.
    I tried using the b2b.filename property in the receive activity and it is not getting the file name.
    <sequence name="main">
        <receive name="Receive_Note" partnerLink="GetB2BNote"
                 portType="ns1:Dequeue_ptt" operation="Dequeue"
                 variable="Receive_Note_Dequeue_InputVariable"
                 createInstance="yes">
                 <bpelx:property name="b2b.fileName" variable="WriteFileName"/>
        </receive>
      </sequence>
    Can you help me to get the file name from Oracle b2b 10g ?
    Thanks,
    b2b user

  • Issue with getting the entire spooled job into the pdf document

    Hi All,
    My scheduled job runs fine and completes successfully but it appears to have some issues with getting the entire spooled job into the pdf document which it sends to a an end user.Has anyone encountered it before.Your kind assistance would be appreciated.
    Thank you.
    Regards,
    John

    Hi,
    Please read below link for your query:-
    http://help.sap.com/saphelp_nw04/helpdata/EN/85/54c73cee4fb55be10000000a114084/content.htm
    Regards,
    Anil

Maybe you are looking for

  • Data Recovery On an iBook G3

    I had an iBook G3 in college (2002, exact model @ http://bit.ly/VGVpSh), and when it died I purchased a new Mac and shoved the iBook in a box (About 7 years ago). It died from the logic board/display issues that all those dual-USB iBooks had. I actua

  • How do I transfer a TV clip to my iPad from a DVD

    How do I transfer a TV clip to my iPad from a DVD

  • Really slow copy and paste function

    I'm having alot of trouble with the copy and paste function in Numbers on my Mac.  I work from home and have to copy and paste alot of spreadsheets and numbers but when I copy a large set of numbers from one spreadsheet to another it takes FOREVER to

  • EBS in Solaris 10 X64

    Hi everybody. I have a licensing doubt. Sorry if this kind of question is misplaced... I have a running EBS 7.4 software server in a Sun Fire X2200M2 Solaris 10 8/07 I know that the Console Server (SUNWebsg) works in Solaris 10 SPARC but not in Solar

  • USD and JPY decimals issue

    Hi all, i am running a sales query in which multiple currencies are displayed. Customer  qty     value 1              10 PC 100.00 USD 2              10 PC 300.00 SGD 3              10 PC 10000.00 JPY <-- here i don't want to have the decimal is ther