File uploads

We need to upload files from the browser to WLS 6.1. No problem getting the data
stream to the servlet. My question if what is the best way to write the file
to a specific directory at the OS level?
Any suggestions if most appreciated.

Do you mean where should you write them to and how to know that from the
servlet?
There is a ServerMBean.getRootDirectory() that will give you the server's
root path. Often this is no more than new
File(System.getProperty("user.dir")).
Or do you mean what java API?
Cheers
mbg
"Ben Carter" <[email protected]> wrote in message
news:[email protected]..
>
We need to upload files from the browser to WLS 6.1. No problem gettingthe data
stream to the servlet. My question if what is the best way to write thefile
to a specific directory at the OS level?
Any suggestions if most appreciated.

Similar Messages

  • Error "A web exception has occurred during file upload" when trying to import ESXi image file into Update Manager

    I'm encountering this error and not sure how to fix, I'm quite new to vCenter so please bear with me.
    I'm trying out vCenter 5.1 with Update Manager 5.1 right now.  No license key has been entered and I still have 50 odd days to try it out.
    2 ESXi hosts are being managed by this vCenter, and they're both running ESXi 4.0
    I'm looking to use Update Manager to try to upgrade the ESXi 4.0 hosts to ESXi 5.1
    I downloaded the image file VMware-VIMSetup-all-5.1.0-799735.iso from VMWare website, and is looking to import it using the Update Manager so I can update the ESXi hosts, but I keep on getting the error:
    File name:     VMware-VIMSetup-all-5.1.0-799735.iso
    Failed to transfer data
    Error was: A web exception has occurred during file upload
    I tried importing it by using vSphere client to connect to vCenter server both remotely and locally, with firewall disabled.
    I've read http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1026602
    I've disabled firewall, and there is no anti-virus program on the server.  I've also restarted the machine several times, to no avail, I didn't reinstall update manager because the whole Windows and VCenter installations are clean from scratch.
    I logged into the vSphere Client using Active Directory credentials, and I've made all Domain Admins (which my account is a member of) part of the administrator group on the vCenter server. I can't log in using admin@System-Domain because it tells me I don't have permissions for it, I still haven't really had the chance to figure out why that is and not sure if that makes a difference.
    Also, I'm fairly certain I'm using the right image file, as I've burned some DVD's used that image file to upgrade some other ESXi hosts.  Unless there's a special image file I need to download?
    I'm at lost on what I can do to make it work.  Please advise.
    Thanks.

    The ISO file you mentioned is the one for vCenter Server. What you need is the "VMware-VMvisor-Installer-5.1.0-799733.x86_64.iso" (or VMware-VMvisor-Installer-201210001-838463.x86_64.iso) for the ESXi host.
    André

  • Change upload file name with com.oreilly.servlet.MultipartRequest to handle the file upload

    1. when use com.oreilly.servlet.MultipartRequest to handle the file upload, can I change the upload file name .
    2. how com.oreilly.servlet.MultipartReques handle file upload? do it change to byte ?
    what  different?  if I use the following method?
       File uploadedFile = (File) mp.getFile("filename");
                   FileOutputStream fos = new FileOutputStream(filename);
                    byte[] uploadedFileBuf = new byte[(int) uploadedFile.length()];
                   fos.write(data);
                 fos.close();

    My questions are
    1) when use oreilly package to do file upload , it looks like i line of code is enough to store the upload file in the
    file direction.
    MultipartRequest multi =
            new MultipartRequest(request, dirName, 10*1024*1024); // 10MB
    why some example still use FileOutputStream?
    outs = new FileOutputStream(UPLOADDIR+fileName); 
        filePart.writeTo(outs); 
       outs.flush(); 
      outs.close();
    2) can I rename the file name when I use oreilly package?

  • BI IP --- Planning function for File Upload

    Hai All,
    In BI IP , When I am trying to load the data (text file) by using Planning function for File Upload. I am getting an error message When I am clicking on Update .
    Error Message : Inconsistent input parameter (parameter: <unknown>, value <unknown>).
    In Text file I am using Tab Separation for each value
    Anyone help me out.
    Thanks,
    Bhima

    Hi Bhima
    Try one of these; it should work:
    1. If you are on SP 14 you would need to upgrade to SP 15. It would work fine
    2. If not, then -
         a] apply note 1070655 - Termination msg CL_RSPLFR_CONTROLLER =>GET_READ_WRITE_PROVIDS
         b] Apply Correction Instruction 566059 [i.e: in Object - CL_RSPLFR_CONTROLLER GET_READ_WRITE_PROVIDS,
    delete the block: l_r_alvl = cl_rspls_alvl=>factory( i_aggrlevel = p_infoprov ).
    and insert block - l_r_alvl = cl_rspls_alvl=>factory( i_aggrlevel = i_infoprov ).
    Goodluck
    Srikanth

  • 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 UI element is not working properly inside Table Popin container

    Hi Expert,
    I created a table with popin, i placed file-upload UI element inside table popin contatiner.
    The file upload UI element is displaying properly but, when i click the browse button to select  the file, the file open dialog box is not popping out.
    will table popin support file-upload UI element inside it?
    it not is there any other way to call a file_open dialog box from inside the table popin.
    Thanks,
    James

    If you are on NetWeaver 7.01, you can try both the ACFUpDownload UI element or try creating your own FileUpload in Adobe Flex with Flash Islands.  ACFUpDownload requires the KPRO by default (which is why the same application isn't working for you), but you can write your own handler class to act as the KPRO receiver.  Here is an eLearning on the topic:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7e04
    and source code:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70645070-bb00-2c10-f086-f126721acdb4
    If you want an eLearning on the FlashIslands approach, you can find it here as well:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50d42644-91ef-2b10-228c-9e0ae75b274e
    and Source Code:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f044b62c-90ef-2b10-64a6-9ec25294d133
    However in both of these approaches you still have to be careful with how you handle large files.  The problem is that they are processed often a single binary string.  This makes the processing easy, but requires total amount of session memory at least as large as the file being uploaded.  In NetWeaver 7.02 ABAP adds the concept of Streams and Locators to help with the partial processing of large files.  This feature doesn't come until later this year, but if you are interested you can learn about it here:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80f983df-213e-2c10-ba89-b5a12ef178e8

  • 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

  • Threading problem during File Upload with Apache faces upload tag

    First I am going to tell you "My Understanding of how JSF Apache Upload works, Correct me if i am wrong".
    1) Restores View (to show Input box and Browse button to facilitate users to select a file for upload)
    2) Translates Request Parameters to Component Values (Creates equivalent components to update them with request values).
    3) Validates Input(Checks to see whether the User has input the correct file)
    4) Updates Backing Bean or Model to reflect the values.
    5) Renders response to user.
    I am uploading huge files of sizes 400MB and above with the help of JSF apache extensions tag
    <h:form id="uploadForm" enctype="multipart/form-data">
    <x:inputFileUpload style="height:20px;" id="upload" value="#{backingbean.fileContents}" storage="file" size="50" />
    </h:form>
    In the backing bean
    private UploadedFile fileContents;
         public UploadedFile getFileContents() {
              return fileContents;
         public void setFileContents(UploadedFile fileContents) {
              System.out.println("File being uploaded...");
              this.fileContents = fileContents;
    Since, the file size is so huge, I am using temp folder to use for the apache tag instead of memory.
    In web.xml i am using like this
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>600m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>10m</param-value>
    </init-param>
         <init-param>
    <param-name>uploadRepositoryPath</param-name>
    <param-value>/uploadfolder/</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    The upload process is working perfectly fine.
    Now coming to the problem:
    Suppose one user is logging into the application & uploading say 400MB of files.
    Until these files are linked to the model objects as my understanding of step 2, if second user tries to open the application he gets stuck with the loading page.
    The page gets loaded only after the request files are linked to the component values(Step 2 above) and updates the backing bean's values.
    I don't see any error in the logs. User is getting stuck. The user is getting stuck only when uploading the files. The other operations like searching are not blocking any other activities performed by the user.
    Server used: IBM Application Server V6.0. CPU is normal, memory usage is normal.

    Dear friend,
    i am also trying to upload using the common file upload.
    when try to run the file error is coming
    can give some suggestion.
    can i use if concurrent user file upload at a time

  • 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

  • File Upload demo problem

    Hi!, i have a problem with the File Upload Demo when it calls this line:
    hDirectoryObject := JFile.new(directory);
    and the error is: error 6508 "PL/SQL: could not find program unit being called"
    That's ok, but anybody knows why should the program couldnt find the routine ?
    And just one more thing...where can i look for JFile method description ??
    Thanks a lot :) !!
    Cristian.

    Is this 9i or 6i?
    JFile is an imported wrapper for a Java Class - it should be in the Demo form already - you could try a compile all on the file just in case.

  • File Upload.. Strange Problem..

    im trying to read file data and print it in the browser. I dont want to save the file. just to read the uploaded file which is TAB delimited..
    First time it works fine. but If I browse back button and reload another file and submit. I am getting content of first file and second file. I closed the browser and reopened it but still problem is not resolved. it keeps on adding file content instead of showing current uploaded file. I dont know what to do.
    here is my code
    upload.html
    <html>
    <head>
    <title>File Upload Form</title>
    </head>
    <body>
    Upload File using this..
    <FORM METHOD="POST" ENCTYPE="multipart/form-data" action="uploadFile.jsp">
    File: <input type="file" name="file"><br>
    <input value="Submit" type="submit">
    </form>
    </body>
    </html>
    UploadFile.jsp
    =============
    <%@page language="java" import="java.io.*" %>
    <%@page language="java" import="java.util.*" %>
    <%!
    private BufferedInputStream bis = null;
    int MAX_LINES = 2000;
    private String currentLine = "";
    //private String[] PartNumber;
    //private String[] Quantity;
    public int disp_counter = 0;
    public int mime_counter = 0;
    public int boundary_counter = 0;
    private String content_diposition = null;
    private HttpServletRequest request;
    private javax.servlet.jsp.JspWriter mOut;
    The incoming request needs to be an InputStream before it can be parsed. This method creates an InputStream from the request. The
    request contains the uploaded file contents
    public void setInputStream(HttpServletRequest request, JspWriter _out)throws IOException {
    try{
    bis = new BufferedInputStream(request.getInputStream());
    } catch(IOException e){
    e.printStackTrace();
    this.request = request;
    this.mOut = _out;
    //mOut.println("After setting input Stream<br>");
    private int getRealContentLength() throws Exception
    boundary_counter = readBoundaryLength(bis);
    content_diposition = readContentDisposition(bis);
    //mOut.println(" getRealContentLength() content_diposition ="+content_diposition+"<br>");
    mime_counter = readUntilBody(bis);
    int tmpContentLength = getContentLength();
    int retLength;
    mOut.println(" getRealContentLength() boundary_counter ="+boundary_counter+"<br>");
    mOut.println(" getRealContentLength() content_diposition ="+content_diposition+"<br>");
    mOut.println(" getRealContentLength() disp_counter ="+disp_counter+"<br>");
    mOut.println(" getRealContentLength() mime_counter ="+mime_counter+"<br>");
    mOut.println(" getRealContentLength() tmpContentLength ="+tmpContentLength+"<br>");
    retLength = getContentLength()-boundary_counter-2-mime_counter-disp_counter;
    return retLength;
    private int readBoundaryLength(BufferedInputStream fis) throws Exception{
    //mOut.println("---- Inside readBoundaryLength ----<br>");
    StringBuffer sb = new StringBuffer();
    byte[] b = new byte[1];
    int counter=0;
    while(true){
    try{
    fis.read(b);
    counter++;
    //mOut.println("RB "+counter+"="+b[0]+"<br>");
    sb.append( new String(b));
    //if('\r'==b[0])
    if(13==b[0]){
    fis.read(b);
    sb.append( new String(b));
    //mOut.println("RB next="+b[0]+"<br>");
    break;
    }catch(IOException e){
    e.printStackTrace();
    //mOut.println("----Counter before return="+counter+" STR="+sb.toString()+"----<br>");
    b = null;
    //mOut.println("---- End readBoundaryLength ----<br>");
    return counter+1;
    private int readUntilBody(BufferedInputStream fis) throws Exception{
    byte[] b = new byte[1];
    mime_counter=0;
    int counter = 0;
    StringBuffer sb = new StringBuffer();
    while(true){
    try{
    fis.read(b);
    sb.append(new String(b));
    mime_counter++;
    //mOut.println("RUntilB "+mime_counter+"="+b[0]+"<br>");
    //if('\r'==b[0])
    if(13==b[0])
    counter++;
    if(counter == 2){
    fis.read(b);
    sb.append(new String(b));
    //mOut.println("RUntilB counter=2 "+mime_counter+"="+b[0]+"<br>");
    break;
    }catch(IOException e){
    e.printStackTrace();
    b = null;
    //mOut.println("RUntilB="+sb.toString()+"<br>");
    return mime_counter;
    private int getContentLength(){
    return request.getContentLength();
    private String readContentDisposition(BufferedInputStream fis) throws Exception{
    byte[] b = new byte[1];
    disp_counter=0;
    StringBuffer sb = new StringBuffer();
    while(true){
    try{
    fis.read(b);
    disp_counter++;
    sb.append(new String(b));
    //mOut.println("ReadCD "+disp_counter+"="+b[0]+"<br>");
    //if('\r'==b[0])
    if(13==b[0]){
    for(int i=1; i < 2; i++){
    sb.append(new String(b));
    fis.read(b);
    //mOut.println("ReadCD before break="+b[0]+"<br>");
    break;
    }catch(IOException e){
    e.printStackTrace();
    //mOut.println("----disp_counter before return="+disp_counter+" STR="+sb.toString()+"----<br>");
    b=null;
    disp_counter += 1;
    return sb.toString();
    private String readNumberOfBytes(BufferedInputStream bis, int count) throws Exception{
    byte[] b = new byte[count];
    byte[] tmp = new byte[count];
    int offset = 0;
    int icount = count;
    int i=0;
    String tmpStr = null;
    try{
    while((i = bis.read(b,0,icount)) != -1){
    System.arraycopy(b,0,tmp,offset,i);
    tmpStr = new String( tmp );
    //mOut.println( "*****"+tmpStr );
    if(icount - i > 0) {
    icount = count - i;
    offset +=i;
    continue;
    else
    break;
    }catch(IOException e){
    e.printStackTrace();
    //for (i=0; i<b.length; i++)
    // mOut.println("AC"+i+"="+b+"<br>");
    return tmpStr;
    public String parseFile( ) throws Exception {
    int len = readAll(bis);
    mOut.println("total len="+len+"<br>");
    //in the first phase, throw away the request parameters that are not required
    //in the second phase, grab the required stuff
    int reallength;
    int mod = 0;
    int div = 0;
    //get rid of the unwanted request content
    reallength = getRealContentLength();//this is the orig line
    //mOut.println( "reallength is " + reallength +"<br>");
    //get rid of boundary and content disp header.
    //int bound_len = readBoundaryLength(bis);
    //String content_disp = readContentDisposition(bis);
    //mOut.println( "Xbound_len" + bound_len +"<br>");
    //mOut.println( "xcontent_disp" + content_disp +"<br>");
    //now we are at partnos,qty
    //int body = readUntilBody(bis);
    if(reallength < 2048){
    currentLine += readNumberOfBytes(bis,reallength);
    else{
    div = reallength / 2048;//buffer default size
    mod = reallength % 2048;
    mOut.println("div ="+div+" mod="+mod+"<br>");
    for(int i=0; i < div; i++)
    currentLine += readNumberOfBytes(bis,2048);
    if(mod != 0)
    currentLine += readNumberOfBytes(bis,mod);
    //mOut.println( "currentLine" + currentLine );
    //ExtractPartNumberAndQuantity();
    //mOut.println("total length="+currentLine.length()+"<br>");
    int lastInd = currentLine.lastIndexOf('\r');
    //mOut.println("lastInd="+lastInd+"<br>");
    lastInd = currentLine.lastIndexOf('\r',lastInd-1);
    //mOut.println("lastInd="+lastInd+"<br>");
    currentLine= currentLine.substring(0,lastInd);
    //mOut.println( "currentLine="+currentLine+"<br>" );
    return currentLine;
    %>
    <%
    out.println(" request length="+request.getContentLength()+"<br>");
    setInputStream(request,out);
    String allLines = parseFile();
    out.println("************** Parsing string starts <br>");
    StringBuffer sb = new StringBuffer();
    sb.append( (char)13 );
    sb.append( (char)10 );
    StringTokenizer st = new StringTokenizer( allLines,sb.toString());
    String line = null;
    // skip the first line as this is header...
    if( st.hasMoreTokens() )
    line = st.nextToken();
    while( st.hasMoreTokens() )
    line = st.nextToken();
    out.println(line+"<br>");
    out.flush();
    %>

    err..
    <%!
    private BufferedInputStream bis = null;
    int MAX_LINES = 2000;
    private String currentLine = "";
    //private String[] PartNumber;
    //private String[] Quantity;
    public int disp_counter = 0;
    public int mime_counter = 0;
    public int boundary_counter = 0;
    private String content_diposition = null;
    private HttpServletRequest request;
    private javax.servlet.jsp.JspWriter mOut;
    that's the problem, most likely.... the <%! part to hold all the variables. Particularly coudl've been a problem if you have multple requests at the same time..

  • How can I make Firefox 4's "File Upload" window start in the same directory across all sites?

    I upload webcomic image files to multiple sites every day--the same file to multiple sites--through the "File Upload" window that comes up in Firefox when you click on a site's "Browse..." file request field.
    In Firefox 3 (under Windows XP), when I used Firefox's "File Upload" window to upload files, the "File Upload" window would come up showing the last directory from which I'd uploaded anything to ANY site.
    In Firefox 4, on the other hand, the "File Upload" window comes up showing the last directory from which I last uploaded to that specific domain.
    I'd like to know if there's an about:config setting--I couldn't find one when searching for "file," "upload," or "dir"--to revert to the Firefox 3 behavior. The reason is that now in Firefox 4, because I typically upload two files to four different web sites per day--one file to all four sites, then later in the day, a second file to all four sites--I have to switch from the first upload directory to the second upload directory in each of the four "File Upload" windows for the second file, whereas in Firefox 3 I only had to do that once. Here's how it used to go:
    In Firefox 3:
    # "File Upload" for file 1 at smbhax.com: have to browse to the local directory where the file is located, since it's a different location than file 2 from the previous day.
    # "File Upload" for file 1 at drunkduck.com: desired local directory is already selected.
    # "File Upload" for file 1 at smackjeeves.com: desired local directory is already selected.
    # "File Upload" for file 1 at comicfury.com: desired local directory is already selected.
    # "File Upload" for file 2 at smbhax.com: have to browse to the local directory where the file is located, since it's a different directory than file 1.
    # "File Upload" for file 2 at drunkduck.com: desired local directory is already selected.
    # "File Upload" for file 2 at smackjeeves.com: desired local directory is already selected.
    # "File Upload" for file 2 at comicfury.com: desired local directory is already selected.
    and here's how it goes under Firefox 4:
    # "File Upload" for file 1 at smbhax.com: have to browse to the local directory where the file is located, since it's a different location than file 2 from the previous day.
    # "File Upload" for file 1 at drunkduck.com: have to browse to the local directory where the file is located, since it's a different location than file 2 from the previous day.
    # "File Upload" for file 1 at smackjeeves.com: have to browse to the local directory where the file is located, since it's a different location than file 2 from the previous day.
    # "File Upload" for file 1 at comicfury.com: have to browse to the local directory where the file is located, since it's a different location than file 2 from the previous day.
    # "File Upload" for file 2 at smbhax.com: have to browse to the local directory where the file is located, since it's a different directory than file 1.
    # "File Upload" for file 2 at drunkduck.com: have to browse to the local directory where the file is located, since it's a different directory than file 1.
    # "File Upload" for file 2 at smackjeeves.com: have to browse to the local directory where the file is located, since it's a different directory than file 1.
    # "File Upload" for file 2 at comicfury.com: have to browse to the local directory where the file is located, since it's a different directory than file 1.
    So basically, where under Firefox 3 I only had to browse through my directories twice per day to upload two files to four sites, under Firefox 4, I have to browse through my directories eight times per day to accomplish the same thing.

    You can use the Remember Password bookmarklet: <br />
    https://www.squarefree.com/bookmarklets/forms.html#remember_password <br /> ''Has worked for me when I have needed it to save a password on a web site that used autocomplete=off.'' As far as the Bug that '''cor-el''' linked, I can't remember ever running across a website that did it like that.
    Or, you can use the Saved Password Editor extension, which includes a means of manually adding Username/Passwords to Firefox. <br />
    https://addons.mozilla.org/en-US/firefox/addon/60265

  • I get a file upload popup when composing an email using Godaddy webmail. How can I prevent this from happening?

    When I try to compose an email from Godaddy's webmail in the Firefox browser. My steps are as follows:
    -Open Firefox.
    -Log in to Godaddy webmail.
    -I hit the compose button.
    -New window pops up. This is the window that I would compose an email in.
    - Right after the compose window loads, I get another window that pops up. This window says "File Upload" in the upper left corner.
    If I exit that window I can then compose my email, and life is good until I want to compose another email. Then the problem repeats. I have contacted Godaddy support and the problem is not on their end. Also the problem DOES NOT happen when using another browser (Internet Explorer).

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • How do I share files uploaded into the Creative Cloud with other creative cloud members?

    How do I share files uploaded into the Creative Cloud with other creative cloud members?

    Should be easy.  Try this...
    In Thumbnails view, click the little triangle (pointing downward) in the lower-right corner of the asset you want to share.
    In the blue icon bar that appears, click the Share icon (the third icon from the left, just right of the trash icon). The Share dialog should pop up.
    In the Share dialog, enter the email address of the person with whom you want to share the asset, then click the Send Email button - they'll receive an email with a link to your asset. OR
    You can also copy a link to the asset and then paste that into your own email client if you prefer.  To do that, click the Link icon (looks like a "chain", and is to the right of the email "envelope" icon) - then click the Copy Link button.
    Note that the Share options won't be available if your asset is set to "Private" - you can control whether an asset can be viewed (or downloaded) by others by clicking the Public/Private control (green or red "lock" icon).
    You can also access the same Share controls if you click on the file to see it one-up (you can do this from either Thumbnails view or List view); click the Share icon near the upper right corner of the browser window (to the right of the asset name).
    Hope that helps.

  • Is there a way to create a file upload page for uploading large documents to a ftp site in Muse?

    I am building a site for a printing company and wanted to know if there was a way to build in a ftp file upload page or button?

    No that is not possible with Muse alone. YOu can host it on Business Catalyst and upgrade the hosting plan to at least the webMarketing plan for general uploading. If it requires each user to have their own profile etc, then you will need to use BC webApps

Maybe you are looking for

  • Matrial wise stock  report

    Hi ABAP Guru's I got a requirement to develop an report which lists the stock(Opening Stock and Closing stock) for each material of a plant in given date range. Can any one  tell me exactly how can i develop this report.? I'll be very thankful if u d

  • How to get the current session details in windows phone 8 when using Facebook ,Google and Microsoft login

    I want to get the session details like access token , provider etc on a page (ExamplePage.xaml.cs) , i used the following example from nokia developers community (link)  and implemented the login part but how can i get session details  so that i can

  • Can I re-download iPod Games that I've purchased?

    I bought all the games that were available when they first came out, transferred them to my iPod (5th Generation) using iTunes for Windows, and everything was peachy. Until I deleted my old Windows XP partition and decided to go with Windows Vista fu

  • Journal Template Utility

    Guys, We are in the process of data conversion and need to post lot of journal entries. Given the HFM Journal interface, it will take a while to create these. I am looking for an excel template to create HFM journals which generate jlf files to speed

  • Sybase&networker restore master error

    I'm try restore master database from networker backup software. but always can't success. The ASE version is 15.7. The Networker version is 8.2. I remember original master device size approx 40MB~70MB, master database size 20M~40M. I don't kown actua