Regarding file upload on BEA CM

Hi,
I am uploading file to BEA CM using CM API by converting file into Binary Type as follows,
BinaryValue bv = createBinaryValueFromImageFile(filePath);
Here filePath is the local path of the selected file in the file dialog.
Now the file and server are in the same machine , it works fine.
I want to know, How it works when file is in local machine and server in somw other machine ?
Any suggestions...
Thanks,
Amit

The line of code that brings up this exception is:
multiReq = new
= new MultipartRequest((ServletRequest)request,
"c:\\temp", 10485760);
try this: MultipartRequest multiReq = new MultipartRequest((ServletRequest)request,
"c:\\temp", 10485760);
(not sure if that is the problem or not..)

Similar Messages

  • I Need Information Regarding File Upload?

    Where can I get information regarding the File uploading packages in Portal. Is there a specification I can get a hold of. I know such a package exists, as it is used by portal itself. I just need to know where I can get hold of information as to what it is called and how to invoke it.

    Suraj,
    The APIs to do file upload are not public as of yet. We are looking into the feature right now. Currently, the only supported method of file upload is using the Web Interface.
    You may find more information about this in the 9iAs Portal forum
    Sue

  • Problems with File Upload on BEA WLS 6.1

    I encountered a problem with Jason Hunters File Upload Classes.
    When uploading a file I always get this exception:
    java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
    at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:175)
    at servlets.uploader.service(uploader.java:21)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:23
    90)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    The line of code that brings up this exception is:
    multiReq = new MultipartRequest((ServletRequest)request, "c:\\temp", 10485760);
    Going directly with the HttpServletRequest doesn't help.
    Can anybody help me out on this one? Thanks in forward.
    Michael

    The line of code that brings up this exception is:
    multiReq = new
    = new MultipartRequest((ServletRequest)request,
    "c:\\temp", 10485760);
    try this: MultipartRequest multiReq = new MultipartRequest((ServletRequest)request,
    "c:\\temp", 10485760);
    (not sure if that is the problem or not..)

  • Problem regarding File Upload

    Hi,
    I have successfully completed the TutWD_FileUpDownload_NW04s_Init. But I am unable to understand where the file is uploaded.Please help me. Its urgent.
    Regards
    Nutan

    If the file is successfully uploaded, it's content is stored in the Web Dynpro context. If you want to save it to disk, you could add the following code to the onActionUploadFile method.
    //IWDModifiableBinaryType binaryType =
    //byte[] file =
    writeByteArrayToFile(new File("/tmp/" + binaryType.getFileName()), file);
    The next code is copied from Commons IO's FileUtils
    public static FileOutputStream openOutputStream(File file) throws IOException {
    if (file.exists()) {
    if (file.isDirectory()) {
    throw new IOException("File '" + file + "' exists but is a directory");
    if (file.canWrite() == false) {
    throw new IOException("File '" + file + "' cannot be written to");
    } else {
    File parent = file.getParentFile();
    if (parent != null && parent.exists() == false) {
    if (parent.mkdirs() == false) {
    throw new IOException("File '" + file + "' could not be created");
    return new FileOutputStream(file);
    public static void writeByteArrayToFile(File file, byte[] data) throws IOException {
    OutputStream out = null;
    try {
    out = openOutputStream(file);
    out.write(data);
    } finally {
    closeQuietly(out);
    public static void closeQuietly(OutputStream output) {
    try {
    if (output != null) {
    output.close();
    } catch (IOException ioe) {
    // ignore

  • Question regarding file upload and download utility

    Hi
    I am able to upload file with file browse contorl of APEX. Now i want to download the uploaded file. Is it possible that if word document is uploaded then when user clicks on it to download, that document is directly opened in microsoft word. Of if PDF file is uploaded then on download it is opened with acorobat pdf.
    Requirement is like when user is downloading any uploaded file denpending on file type (text,excel,pdf,doc) relative application should opened with that document.
    Thanks in advance

    That is controlled by settings in the browser that you cannot change. For instance, I have my browsers configured to use FoxIt PDF reader instead of Acrobat reader for PDFs, but no website could change that. The same is true when it comes to downloading vs opening. Sorry.
    Tyler Muth
    http://tylermuth.wordpress.com
    "Applied Oracle Security: Developing Secure Database and Middleware Environments": http://sn.im/aos.book

  • Regarding file uploading to application server

    hi ,
    i am facing a problem while uploading a .csv file to the application server.
    it is going to dump.
    error is ,
    the capacity limit has been reached
    pls urgent .
    points are assured.

    try these link, if still there is problem, write the error analysis from st22
    http://www.sap-img.com/ab004.htm
    http://sap.ittoolbox.com/topics/t.asp?t=303&p=448&h2=322&h1=303&h3=448
    http://www.sapdevelopment.co.uk/file/file_uploadsap.htm
    ajay

  • Regarding file upload in struts

    how can i save file in give location in struts.when i am using in <forward> tag it is opening in the given path that is file name but i want to save the file in the given location

    Hi Ravindranath,
    I tried it again. It worked for me. Check your GUI_UPLOAD parameters.
    Here is my code.
    data: begin of record occurs 0,
    * data element: MATNR
            MATNR_001(018),
    *other fields
          end of record.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'D:datatestnew.txt'
       HAS_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                      = record
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17

  • File uploading in XI

    Hi all,
    I am new to this XI coding. I have an requirement regarding file uploading in XI.
    The flat file is in XLS format. How to upload this .xls file into XI? What are the steps to be followed?
    can anyone give step by step procedure for uploading a xls file into XI system?
    Thanks in advance,
    Vijay.

    Hi,
    <How to upload this .xls file into XI?>
    Do you mean that, you have done all the configuration and now you want to upload the file into test directory of XI server for testing purpose using NFS mode??
    If your ans is Yes, then use <b>tcode SXDA_TOOLS</b> to upload the file into applicaion server (XI) and use tcode <b>AL11</b> to see the file which you have uploaded into source directory of XI.
    Regards,
    Sarvesh

  • File upload JSP

    Yet again the issue of file upload...?:|
    I am trying to use a file upload as part of my screenflow.
    I besically have 2 jsp files. jsp file upload code and the supporting HTML.
    I created 2 "interactive component calls", connected with a transition and in the 1st one I call one JSP and in the 2nd one the other JSP.
    My action on my HTML is action="fileupload.jsp" (my upload code file) I try changing it to action="&lt;f:postResults /&gt;" but that didnt work
    Then I changed my action to "&lt;f:postResults fowardUrl="fileupload.jsp"/&gt; I got an error on that too.
    Anyone can help with that issue? I am besically tring to do a simple file upload from my sub-process.
    Thank You
    Lilach

    Hi,
    There was a sample application regarding File Upload in Fuego 5.5. My mail id is [email protected] If you want then drop me a mail and I can send across the export of the same to you.

  • File Upload in Portal Enviroment

    I have a web page with a File Upload tag, and a PageFlow with a Form Bean where
    it has a FormFile attributte. When i run this pageFlow, it run excelent, but when
    the pageFlow is in a porlet of the portal, never upload the file. What i have
    to do?? Please... help me!!!

    It's a patched version of netui-pageflow.jar that is going to be in the
    next sp. For now you have to get it directly from BEA support.
    /Steen
    Juvenal Guzman wrote:
    Steen,
    Which patch I have to get? Because only found Service Pack 1 for App Server 8.11
    and that's it..
    Regards
    Juvenal
    Steen Larsen <[email protected]> wrote:
    Hi,
    It's a bug. You can get a patch from BEA support.
    /Steen
    Daniel Montenegro wrote:
    I have a web page with a File Upload tag, and a PageFlow with a FormBean where
    it has a FormFile attributte. When i run this pageFlow, it run excelent,but when
    the pageFlow is in a porlet of the portal, never upload the file. Whati have
    to do?? Please... help me!!!

  • How to download a file uploaded in the portal admin console

    Hi All ,
    I have created a content using admin console.
    It has a property called , "file", and it is of type "Binary".and its primary property
    I need to have link in JSP , to download that file/content.
    I am using <templates tag , but not able to download.
    Could you pls suggest how to download a file uploaded to admin console
    Thanks & Regards,
    Srinivas

    Srinivas,
    Check the WLP API http://e-docs.bea.com/wlp/docs102/javadoc/index.html?overview-summary.html
    Search for com.bea.content.manager.servlets.ShowBinaryServlet class and com.bea.content.manager.servlets.DownloadBinaryServlet class. You can use one of these depending on your requirment. I think there is not jsp tag for these classes so you have to use scriptlets.

  • FILE UPLOAD PROBLEM SHOWING THE CONTENTS IN THE SAME BROWSER WINDOW

    Hi,
    This is amit Joshi
    I have uploaded content using input tag of type file and posted to jsp as multipart/form-data type
    in that jsp i am using following code to display the content in browser but only first content is displayed How can i modify it to show all content in the file ..
    <html>
    <head>
    <title>File Upload Display</title>
    </head>
    <body>
    <%
    //ServletOutputStream sout=response.getOutputStream();
    StringBuilder strBuilder = new StringBuilder();
    int count=0;
    String f;
    f=request.getParameter("filedb");
    DBManager dbm = new DBManager();
    //dbm.createTable("mms3");
    //log.info("In JSP : "+ f);
    //dbm.insert_data(f,"mms3");
    %>
    <%
    if (ServletFileUpload.isMultipartContent(request)){
    ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());
    List fileItemsList = servletFileUpload.parseRequest(request);
    strBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>").append('\r').append('\n').append("<xpage version=\"1.0\">").append('\r').append('\n');
    String optionalFileName = "";
    FileItem fileItem = null;
    Iterator it = fileItemsList.iterator();
    ServletOutputStream outputStream=null;
    while (it.hasNext()){
    FileItem fileItemTemp = (FileItem)it.next();
    if (fileItemTemp.isFormField()){
    %>
    <b>Name-value Pair Info:</b>
    Field name: <%= fileItemTemp.getFieldName() %>
    Field value: <%= fileItemTemp.getString() %>
    <%
    if (fileItemTemp.getFieldName().equals("filename"))
    optionalFileName = fileItemTemp.getString();
    else
    fileItem = fileItemTemp;
    if (fileItem!=null){
    String fileName = fileItem.getName();
    %>
    <b>Uploaded File Info:</b>
    Content type: <%= fileItem.getContentType() %>
    Field name: <%= fileItem.getFieldName() %>
    File name: <%= fileName %>
    <%
    if(fileItem.getContentType().equals("image/jpeg")) { %>
    File : <p><%
         //response.setContentType("image/gif");
         byte[] bArray=fileItem.get();
         response.setContentType("image/jpeg");
         outputStream=null;
         outputStream= response.getOutputStream();
         outputStream.write(bArray);
         outputStream.flush();
         outputStream.close();
    else if(fileItem.getContentType().equals("text/plain"))
         %> File : <%= fileItem.getString() %>
    <%
    byte[] bArray=fileItem.get();
    response.setContentType("text/plain");
         outputStream = response.getOutputStream();
         out.println();
         outputStream.write(bArray);
         outputStream.flush();
         outputStream.close();
    %> </p> <%
    %>
    </body>
    </html>
    Edited by: Amit_Joshi on Nov 13, 2007 10:58 PM

    Well Well Well..
    That would not work...
    What you have to do is save the uploaded file content on to a location and then pass the fileName as a request parameter to a deidicated which displays the contents of that file.
    Just as an example
    <html>
    <head>
    <title>File Upload Display</title>
    </head>
    <body>
    <%
    //ServletOutputStream sout=response.getOutputStream();
    StringBuilder strBuilder = new StringBuilder();
    int count=0;
    String f;
    f=request.getParameter("filedb");
    DBManager dbm = new DBManager();
    //dbm.createTable("mms3");
    //log.info("In JSP : "+ f);
    //dbm.insert_data(f,"mms3");
    %>
    <%
    if (ServletFileUpload.isMultipartContent(request)){
    ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());
    List fileItemsList = servletFileUpload.parseRequest(request);
    strBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>").append('\r').append('\n').append("<xpage version=\"1.0\">").append('\r').append('\n');
    String optionalFileName = "";
    FileItem fileItem = null;
    Iterator it = fileItemsList.iterator();
    ServletOutputStream outputStream=null;
    while (it.hasNext()){
       FileItem fileItemTemp = (FileItem)it.next();
    %>
    Name-value Pair Info:
    Field name: <%= fileItemTemp.getFieldName() %><br/>
    Field value: <%= fileItemTemp.getString() %><br/>
    <%
    if (fileItemTemp.getFieldName().equals("filename"))
        optionalFileName = fileItemTemp.getString();
    if(!fileTempItem.isFormFiled()){
       String fileName = fileItem.getName();
       fileItem.write(optionalFileName);
    %>
    Uploaded File Info:
    Content type: <%= fileItem.getContentType() %><br/>
    Field name: <%= fileItem.getFieldName() %><br/>
    File name: <%= fileName %><br/>
    <%
    if(fileItem.getContentType().equals("image/jpeg") || fileItem.getContentType().equals("image/pjeg")) {
    %>
      <img src="FileServlet?fileName=<%=optionalFileName%>"   
    <%
    %>
    </body>
    </html>a sample code snippet for FileServlet.
    String fileName =  request.getParameter(fileName);
      File file = new File(fileName);
       if(!file.exists())
         return;
      // If JSP
      String mimeType = application.getMimeType("fileName");
           If you are using servlet
           String mimeType = this.getServletContext().getMimeType(fileName);
         response.setContentType(mimeType);  
         response.setHeader("Content-Disposition","inline;filename=\\"+fileName+"\\");
      BufferedOutputStream out1 = null;
      InputStream in = null;
      if(mimeType == null)
         mimeType = "application/octet-stream";
      try{
         in = new FileInputStream(f);
         response.setContentLength(in.available());
         BufferedOutputStream out1 = new BufferedOutputStream(response.getOutputStream(),1024);
         int size = 0;
         byte[] b = new byte[1024];
         while ((size = in.read(b, 0, 1024)) > 0)
            out1.write(b, 0, size);
      }catch(Exception exp){
      }finally{
          if(out1 != null){
             try{
                out1.flush();               
                out1.close();
             }catch(Exception e){}
          if(in != null){
            try{in.close();}catch(Exception e){}
      } Hope that might answer your question :)
    However,this is not the recommended way of doing this make use of MVC pattern.Would be a better approach.
    you might think of googling on this and can findout what is the best practise followed for problems of this sort
    REGARDS,
    RaHuL

  • Unable to get the filename from file upload UI element

    Hi,
    I added a FileUpload UI element.
    I created an attribute of type resource , assigned to the resource property of the file upload element.
    I created an action button called upload and added the following code.
    try {
           IWDResource resource = wdContext.currentContextElement().getFileupload();
          } catch (Exception e) {
             e.printStackTrace();
    when I debug to see the value of resource it is null.
    Please let me know where I am going wrong.
    Regards,
    Narayani

    Hi,
    Check if there are any space characters in your uploading path (file path).
    First try to upload a file without any space characters in the uploading path(file path). If the problem is with the space characters then use the below encoding & decoding to resolve that issue.
    Encoding while uploading the file:
    // Getting the file resource
    IWDResource resource = element.getCtx_va_FileResource();
    //Getting the resource name
    String resourceName = resource.getResourceName();
    //Encoding the resource name
    String encoderesourceName = java.net.URLEncoder.encode(resourceName,"UTF-8");
    Again while downloading you can use decoder.
    Hope this helps to resolve your issue.
    See this below link.
    Re: File Upload Problem
    Try this encoding even if there are no space characters.
    Regards,
    Charan

  • File Upload applet not opening in Query Mode

    File Upload Applet is opening in Query Mode in Siebel 7.5, where as in Siebel 7.8 its not opening in Query Mode.
    Should anything be changed in CFG? or siebel restricted this?

    Hi,
    There is a property called "Auto Query Mode" in the applet. Check whether this has been set to "New Query" in 7.5. If so the applet will be opening in Query Mode automatically. If this property is blank, in 7.8, the applet will not be opening in Query mode. Check and let me know.
    Regards,
    Joseph

  • File Upload element Problem

    Hello All,
    We have a problem regarding the File Upload button in Webdynpro.
    when we upload a file using this element and goto another view and comeback, the upload element is not showing any filename.
    But when debugged, the fileupload context node still has the data. Just it is not showing in the UI.
    Is it an existing problem with File Upload? Or do we have to do anything to make the filename visible.
    Thanks,
    Anand

    Hi,
    this works as designed, see the section on browser details <a href="http://help.sap.com/saphelp_nw70/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm">here</a>
    Regards, Heidi

Maybe you are looking for