How to Upload a File in Bpel Process using JSP

I am trying to upload file in bpel process using front end as a Jsp.
i create the jsp page and i am able to pass the value from jsp to bpel process.
In bpel process i don't know how to pass or assign the specified file name into file adapter for reading the files.
Please help me...
Saravanan

You don't assign the url of the file to it.
To either get the data from the file into the bpel process you could use the url-parameter together with the ora:readFile function....or you could let your web-application upload the file to some location on the server...and on this location you could use the file-adapter together with the polling, to start your bpel process.

Similar Messages

  • How to upload a file in BPEL Console Using JSP in JDeveloper, please help..

    Please I am new to Jdeveloper and to BPEL Process of OASuite,I want to know , how to upload a file in BPEL process using JSP in Jdeveloper IDE.
    The main aim is first we need to upload a file in JSP , it has to go to BPEL Process & it has to read the file & write the respective file in return to JSP through BPEL Process. Please I am in Urgent need of the Query , please help me ASAP.
    Send to me response Please.....................................

    Hi,
    I thin that you asked the same question before and I premember that I ointed you to the ADF BC developer guide and the SRDemo if your application uses JSF. For plain JSP - if you Google for: JSP and file upload then you find plenty of sources for JSP and Struts.
    The remaining part is how to stiff the file into a BPEL service on the middle tier. For this I recommended to ask your question on the BPEL forum
    BPEL
    Note that the BPEL integration would be easier if it was done on the middle tier and not onthe client
    Frank

  • How to upload a file in BPEL Console Using JSP in JDeveloper, pleae........

    I am very new to this JDeveloper & BPEl Process , please could some one help in ersolving my problem that is , how to upload a file in BPEL Console Using JSP in JDeveloper.

    Hi,
    ADF Faces provides you with the file upload component
    http://download-uk.oracle.com/docs/html/B25947_01/web_complex006.htm#CEGCEDHF
    http://download-uk.oracle.com/docs/html/B25947_01/appendixa007.htm#CHDEDCFA
    This gives you a handle to the file content. However, uploading files through a service is different and I suggest to consult teh BPEL forum for this BPEL
    Frank

  • How to Call Custom BPEL Process using JSP

    Hi All,
    I m not able to find out the way " How to deploy Custom BPEL process using JSP." Suppose I m Designing my custom BPEL process , and I want to call process through JSP.
    In order to call the BPEL process using JSP I may get the Reference from Oracle guide, But it is for Existing Example like Hello world, Order Booking.
    But I am facing the problem in order to call the Custom BPEL process.
    In case of Oracle Example it looks Simple but How to call Custom BPEL process using JSP.
    Please help me.
    Thanks&Regards
    Devesh Mishra

    hi
    The BPEL Developer guide give the way to Locate the service.can you please specify where you are getting the problem.
    Thanks,
    Sivakumar

  • Invoking BPEL process using JSP.

    HI,
    I m trying to invoke my BPEL process using JSP. When tried to invoke, Webpage doesnt display any message.
    This is the error, I could collect from log file:
    <PAYLOAD>
    <MSG_TEXT>ServletException cause</MSG_TEXT>
    <SUPPL_DETAIL><![CDATA[com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is null. Please check the process instance for detail.
         at com.collaxa.cube.ejb.impl.DeliveryBean.request(DeliveryBean.java:109)
         at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:620)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at DeliveryBean_RemoteProxy_4bin6i8.request(Unknown Source)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:104)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at _InvokeDemo__BPEL._jspService(_InvokeDemo__BPEL.java:85)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at com.collaxa.cube.fe.DomainFilter.doFilter(DomainFilter.java:116)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:396)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:410)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is null. Please check the process instance for detail.
         at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequestAnyType(DeliveryHandler.java:528)
         at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequest(DeliveryHandler.java:451)
         at com.collaxa.cube.engine.delivery.DeliveryHandler.request(DeliveryHandler.java:125)
         at com.collaxa.cube.ejb.impl.DeliveryBean.request(DeliveryBean.java:95)
         ... 46 more
    ]]></SUPPL_DETAIL>
    </PAYLOAD>
    </MESSAGE>
    My BPEL process is a simple process, to get the value from receiver and pass to ouput.
    Could someone tell me how to resolve this error....
    Thanks in Advance
    Ajay

    I am having a similar issue while invoking webservice in ODI I am getting following error. Let me how did you resolve your issue.
    com.sunopsis.wsinvocation.SnpsWSInvocationException: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is null. Please check the process instance for detail.
         at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)
         at com.sunopsis.graphical.wsclient.f.b(f.java)
         at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
         at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
         at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is null. Please check the process instance for detail.
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.content(Unknown Source)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.content(Unknown Source)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
         at org.apache.crimson.parser.Parser2.parse(Unknown Source)
         at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
         at javax.xml.parsers.SAXParser.parse(Unknown Source)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:1792)
         at com.sunopsis.wsinvocation.client.a.a.d.a(d.java)
         ... 8 more
    Caused by:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
    faultSubcode:
    faultString: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is null. Please check the process instance for detail.
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace:com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is null. Please check the process instance for detail.
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.content(Unknown Source)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.content(Unknown Source)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
         at org.apache.crimson.parser.Parser2.parse(Unknown Source)
         at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
         at javax.xml.parsers.SAXParser.parse(Unknown Source)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:1792)
         at com.sunopsis.wsinvocation.client.a.a.d.a(d.java)
         at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)
         at com.sunopsis.graphical.wsclient.f.b(f.java)
         at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
         at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
         at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Unknown Source)
         {http://xml.apache.org/axis/}hostname:sullah-us
    com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is null. Please check the process instance for detail.
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.content(Unknown Source)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.content(Unknown Source)
         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
         at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
         at org.apache.crimson.parser.Parser2.parse(Unknown Source)
         at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
         at javax.xml.parsers.SAXParser.parse(Unknown Source)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:1792)
         at com.sunopsis.wsinvocation.client.a.a.d.a(d.java)
         at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)
         at com.sunopsis.graphical.wsclient.f.b(f.java)
         at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
         at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
         at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Unknown Source)

  • How to design multiple file polling BPEL process?

    Hi all,
    I am trying to solve/design the following in BPEL process:
    - The integration process flow I am trying to design is an interaction b/n system A (FTP server), an Integration platform and system B.
    - The integration platform will poll files from an internal FTP server. It has 2 Time files (“Time1” and “Time2”) alternatives to poll from the FTP server. It will then transform the message/information inside the files (time information) to an internal XML format. At the end it shall send the message to system B.
    - The information inside the files is identical. The reason to have 2 files with identical information is for redundancy. The integration-platform shall only poll file “TIME1” as long as the conditions are met. If the conditions are not met, then it polls file “Time2”.
    Normal succeeded scenario:
    1- The integration platform polls the latest “Time1” file from the internal FTP server. The polling is done every 15th minute.
    2- The integration platform logs to BAM and reports that the file is received.
    3- The platform then converts the message to an internal format.
    4- The platform sends the converted message/time information to system B.
    5 - The use-case ends.
    Not normal scenario:
    1- The platform cannot get/receive file “Time1” file.
    - The platform logs to BAM and reports that the file could not be received.
    - The platform polls file “Time2” from the FTP server and it does the same normal scenario as above. The use case ends.
    2 - Time message/information from the Time1 file has not full information (less than 24 rows). The file is supposed to have 24 rows (for 24 hours).
    - The platform logs to BAM and reports that there is missing information on the message.
    - The platform gets/polls instead the “Time2” file from the FTP server and it does the normal scenario.
    - The use case ends.
    3- The platform can find/get neither file “Time1” nor “Time2”.
    - The platform alarms to BAM that it could not get/find the files.
    ** I am considering either the pick activity or the switch activity solution. Does any one of you have an idea how to design this in oracle BPEL process?
    Thanks.

    Not sure I understand your use case completly so if I'm off track I apploigise.
    I think there are 3 ways to solve this. The 3rd may be closest to what you are looking for.
    1. Have 2 processes that read into a common area, e.g. database where you can compare. From there you can choose which file to pick. This is high leve but I think this would be dificult to implement.
    2. Implement a combination of a rejectedMessage handler and error processing witn the BPEL process itself. The rejecte message handler can call another BPEL process if the time1 file is in a invalid state. This process will then read the time2 file. The issue with this is that the rejecte message handler will only get invoked when the file doesn't conform to the schema.
    3. Use the quarts scheduler whcih invokes a BPEL process every 15 miniutes. Using the file adapter to perform a synchronous read to read time1, analyse it, if it fails read time2 using synchronous read. Then perform the approprate action id this fails.
    hope this give some ideas.
    cheers
    James

  • How to upload excel file in Webdynpro application using ABAP

    Hi Experts,
    Am developing a webdynpro application in which it will take an excel file as input and display the contents in the form of a table in output. I am able to upload tab delimited text file and populate the table using the below code but not able to do the same with .xls file. Pls let me know if I need to use a different function module for upload excel file.
    get single attribute
      wd_context->get_attribute(
        EXPORTING
          name =  `DATASOURCE`
        IMPORTING
          value = l_xstring ).
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          in_xstring = l_xstring
        IMPORTING
          out_string = l_string.
      SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
    Bind With table Element.
      LOOP AT i_data INTO l_string.
        SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
        READ TABLE fields INTO lv_field INDEX 1.
        fs_table-name = lv_field.
        READ TABLE fields INTO lv_field INDEX 2.
        fs_table-age = lv_field.
        APPEND fs_table TO t_table1.
      ENDLOOP.
    lo_nd_data = wd_context->get_child_node( 'DATA_TAB' ).
    lo_nd_data->bind_table( T_TABLE1 ).
    Thanks,
    Subathra

    Dear Exports
    Can anyone guide me how to uplode the .xlsx or ..xls formatted excel file using abap webdynpro without converting it to .txt file. Because my client requirement is only to upload the excel file. because to convert the .xlsx flie to .txt file it will be time taking and cost expanssive. Another requirement is suppose today i have create a application for uploading a file which has 8 columns and 10 rows. suppose tomorrow the client will make some changes in that flat file means the client will add 2 extra columns and 10 more columns in that fil. and will upload that file. Then the new file will be display on the browser or old file. but my requirement is to display the new file in browser.
    Can anyone kindly help to solve my problem. I am completely fresher in this field and I need to do it as soon as possible. Please help to solve the problem. 
    Regards
    Rashmita

  • How to upload/download file to/from server using FiledownloadUI ?

    Hi experts,
    I don't have much experience of WDABAP. I have to upload a file  to server and then download it again. I have implemented  this functionality but I am unable to view contents of .xls/.doc/.docx/.msg file only  txt file contents are properly visible. I have used  following command to upload the file:-
    OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
    I had  also tried this but it is throwing  exception that it can be used only for character type data.
    OPEN DATASET fname FOR OUTPUT IN TEXT MODE  ENCODING UTF-8    WITH SMART LINEFEED.  
    Thanks in advance.
    Problem Solved!
    Regards,
    Vishesh
    Edited by: Vishesh@1986 on Sep 26, 2011 7:37 AM

    I have resolved the issue myself!!!

  • How to upload a file to the server using ajax and struts

    With the following code iam able to upload a file ato the server.
    But my problem is It is working fine if iam doing in my system nd when iam trying to
    access theis application from someother system in our office which are connected through lan
    iam getting an error called 500 i,e internal server error.
    Why it is so???????
    Plz help me????????
    It is required in my project.
    I want the code to access from every system.
    My exact requirement is i have to upload a file to the server and retrive its path and show it in the same page from which we
    have uploaded a file.
    Here the file has to be uploaded to the upload folder which is present in the server.Iam using Tomcat server.
    Any help highly appreciated.
    Thanks in Advance
    This is my input jsp
    filename.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <script type="text/javascript">
    alertflag = true;
    var xmlHttp;
    function startRequest(file1)
         if(alertflag)
         alert("file1");
         alert(file1);
    xmlHttp=createXmlHttpRequest();
    var video=document.getElementById("filepath").value;
    xmlHttp.open("POST","FilePathAction.do",true);
    xmlHttp.onreadystatechange=handleStateChange;
    xmlHttp.setRequestHeader('Content-Type', application/x-www-form-urlencoded');
    xmlHttp.send("filepath="+file1);
    function createXmlHttpRequest()
         //For IE
    if(window.ActiveXObject)
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         //otherthan IE
    else if(window.XMLHttpRequest)
    xmlHttp=new XMLHttpRequest();
    return xmlHttp;
    //Next is the function that sets up the communication with the server.
    //This function also registers the callback handler, which is handleStateChange. Next is the code for the handler.
    function handleStateChange()
    var message=" ";
    if(xmlHttp.readyState==4)
         if(alertflag)
              alert(xmlHttp.status);
    if(xmlHttp.status==200)
    if(alertflag)
                                       alert("here");
                                       document.getElementById("div1").style.visibility = "visible";     
    var results=xmlHttp.responseText;
              document.getElementById('div1').innerHTML = results;
    else
    alert("Error loading page"+xmlHttp.status+":"+xmlHttp.statusText);
    </script></head><body><form >
    <input type="file" name="filepath" id="filepath" onchange="startRequest(this.value);"/>
    </form>
    <div id="div1" style="visibility:hidden;">
    </div></body></html>
    The corresponding action class is FIlePathAction
    package actions;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.*;
    public class FilePathAction extends Action{
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException
              String contextPath1 = "";
              String uploadDirName="";
              String filepath="";
                        System.out.println(contextPath1 );
                        String inputfile = request.getParameter("filepath");
                        uploadDirName = getServlet().getServletContext().getRealPath("/upload");
                        File f=new File(inputfile);
    FileInputStream fis=null;
    FileOutputStream fo=null;
    File f1=new File(uploadDirName+"/"+f.getName());
    fis=new FileInputStream(f);
         fo=new FileOutputStream(f1);
                        try
         byte buf[] = new byte[1024*8]; /* declare a 8kB buffer */
         int len = -1;
         while((len = fis.read(buf)) != -1)
         fo.write(buf, 0, len);
                        catch(Exception e)
                                  e.printStackTrace();
                        filepath=f1.getAbsolutePath();
                        request.setAttribute("filepath", filepath);
                        return mapping.findForward("filepath");
    Action-mappings in struts-config.xml
    <action path="/FilePathAction"
                   type="actions.FilePathAction">
                   <forward name="filepath" path="/dummy.jsp"></forward>
              </action>
    and the dummy.jsp code is
    <%=request.getAttribute("filepath")%>

    MESSAGE FROM THE FORUMS ADMINISTRATORS and COMMUNITY
    This thread will be deleted within 24 business hours. You have posted an off-topic question in an area clearly designated for discussions
    about Distributed Real-time Java. Community members looking to help you with your question won't be able to find it in this category.
    Please use the "Search Forums" element on the left panel to locate a forum based on your topic. A more appropriate forum for this post
    could be one of:
    Enterprise Technologies http://forums.sun.com/category.jspa?categoryID=19
    David Holmes

  • How to upload a file to different location using CS Template

    Hi,I have a Data Entry Template with a "File" field and when I upload a document it uploads in the same directory where the Content Item is created. Is there any way to upload the document to some other directory in the Content Server. Say I have a Html folder and there is a template which has a 'file' field. After Saving the content item the uploaded file gets saved in the same folder (Html) in content server, I would like to upload the document in a different folder called "Docs" and the content item in Html folder.Is it possible? If yes then can you please guide me.Thanks,Yaju

    Hi Rajesh,
    Use below code on your "Upload" Action:
         try
    // Give full path of folder on server where you want to upload the file.
              File file = new File("D:\\usr\\sap\\Images\\"+wdContext.currentContextElement().getResource().getResourceName().toString());
    // D:\usr\sap\Images folder should present on server
              FileOutputStream op = new FileOutputStream(file);
              if(wdContext.currentContextElement().getResource()!=null)
                   text=wdContext.currentContextElement().getResource().read(false);
                        while((temp=text.read())!=-1)
                             op.write(temp);
              op.flush();
              op.close();
         catch(Exception e)
              wdComponentAPI.getMessageManager().reportSuccess("Error while uploading file : "+e.getMessage());
    Thanks
    Sandy

  • How Can Hide The File Name in URL Using Jsp

    I Want source code for Hiding The File name in url address using jsp.
    for example www.website/login.jsp is view but i want www.website/ only.

    Hi Praveen - how does that DEF would be determined?
    Have a look at the below blog for executing os commands
    SAP XI File Adapter OS Command Line Feature - Process Integration - SCN Wiki
    XI/PI: Command line sample functions
    Is there any problem in using the dynamic file name configuration??
    Message was edited by: Hareesh Gampa

  • How to open a file located at server using JSP

    hi,
    i would like to open a file located at server as it is. I mean to say, if it a MS Word file, i wanna open it in MS Word, if it an Excel file, i wanna open it in Excel. i know the location (path) of the file. Can someone help me please.
    Thanx

    The best way would simply be to HREF it.
    ie<a href="excelfiles/spreadsheet.xls">Open spreadsheet</a>When a user then clicks on that lick in their browser they should be given the option to either download or (if they have the appropriate program, in this case MS Excel, installed) open it.
    This works best if the client is using a version of Internet Explorer (if you're dealing with MS files), but any browser should potentially offer you the option of opening the file.
    Beyond that there's no way to specifically open a program on a client machine (it'd be a bit of a security loophole if you could! - Imagine a JSP page being able to open FDISK...). All you can do is pass the file (via the HREF) and let the client decide what to do with it.

  • How to upload multiple files in Webdynpro using File upload Screen Element

    Hi Experts,
          Can anybody tell me how to upload multiple files/pdfs in webdynpro using file upload screen element, and also please tell me what is the maximum storage limit of RAWSTRING data type,Advance Thanks.
    Regards,
    Sandesh

    Hi Sandesh,
    this is simply not supported, not in WebDynpro nor in standard HTML.
    A workaround is to upload a ZIP with all files and on server side unpack the ZIP and operate on the single files.
    I hope it will  help u..
    ----------------------OR-------------------------
    As you know using File upload UI element we can upload only one file at a time. There may be a scenario where user may want to upload any no of files at a time which is not determined at design time. This can be acheived using the ACF UpDownload UI element which requires a security whiltelist to be created
    http://scn.sap.com/docs/DOC-2270
    ----------------------OR-------------------------
    You can use Table UI element.
    Regards,
    Deepak Singh

  • How to upload a file using psp?

    how to upload a file to a server using plsql server pages?

    for report generation we are using utl_file(this is because for getting .txt format).so automatically it will be stored in /home/oracle.(oracle 8.1.7 on linux and utl_file path is /home/oracle)
    our problem is
    our clients are using windows98.by running the reports procedure(psp) the reports are stored in server at /home/oracle.
    1.how to transfer that file to clients systems with out using another alternate file transfers?
    2.if not,is there is any alternate procedures for creating our reports in .txt formats by running the psp?
    thanks in advance.

  • How to read values from Property file into BPEL process local variable?

    I would like to use a Property file with some parameters e.g.
    <myparm1>12345</myparm1>
    How can I read from a BPEL process such a Property file and assign it into e.g. local variable "intparm1"?
    Where (in which directory) should I put this XML Property file to have it always available for reading?
    Peter

    Hi,
    You can also use
    ora:readFile( ) function as follow :
    ora:readFile(xml file location (ex. "file:///D:\\SOA\\FileAdapters\\readFile\\test\\test.xml"),xsd file location (ex."file:///D:\\SOA\\FileAdapters\\readFile\\test\\test.xsd"))
    inside the assign activity and assign this to the variable you want.
    regards
    arababah
    Edited by: arababah on Aug 10, 2009 12:55 AM

Maybe you are looking for