Excel file processing in jsp

Hello friends
I want to read Excel files jsp(or java).I used sql driver,but it does'nt reads the file properly.I want to read file in jsp.I went thr many sites and found many ways like apache poi,JExcel api etc
I found JExcel api is not free.I am getting errors with poi.I found no proper documentation on it.On apache site there are many versions to download poi packages.I confused about which to download.
If any one has used poi successfully,please let me know

related to POI
**POI**
Site
http://poi.apache.org/Api
http://poi.apache.org/apidocs/index.htmlExamples
http://www.google.co.in/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=7WV&q=POI+examples&btnG=Search&meta=

Similar Messages

  • Opening Excel  files from a JSP page

    Hi,
    I am not able to open up an Excel file through JSP.
    I am using following code snippet in JSP page
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","inline; filename=Test.xls");Do i need to do additional settings for rendering Excel from a JSP
    Thanks in advance !!!

    Hi,
    In my application , we have Excel files on the server i.e we are not creating excel sheets.
    I just want to display these static excel files through a jsp.
    I am able to display the excel files by reading them into ByteArrayOutputStream
    <%
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment; filename=B.xls");
    ServletOutputStream so = response.getOutputStream();
    String filename = "D:\\Test.xls";
    String mimetype = "application/vnd.ms-excel";
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    InputStream in = new BufferedInputStream(new FileInputStream(filename));
    byte bytebuff[] = new byte[500];
    for(int lengthread = 0; (lengthread = in.read(bytebuff)) != -1;){
    output.write(bytebuff, 0, lengthread);
    byte data[] = output.toByteArray();
    response.setContentType(mimetype);
    so.write(data);
    in.close();
    so.close();
    %>But my question is that , do i really need to do all this for rendering excel through a jsp.
    Can't i do it by just setting the content type ?
    Thanks

  • Problem making an Excel file from a jsp

    Hi.
    I'm developing a web application that uses Excel for printing the reports. So far everything has worked fine, at least for the created Excel files that do not have any images on them. Now I need to create an excel file with an image as the header. I tried adding the necessary code to include the image, but when I open it, the image is not displayed (like when you open an HTML page that could load a certain image). I tried using different ways to set the src to see if maybe the path was the problem, but everytime I got the same result...
    How can I do this? How can I include the image and actually display it when the user opens the file in Excel?
    Thanks in advance
    CyberSpider

    I had a similar porblem....
    I got some help from...http://www.javaworld.com/javaworld/jw-10-2006/jw-1019-xmlexcel.html?page=1...
    This is my code in servlet...
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet spreadSheet = wb.createSheet("Users");
    spreadSheet.setColumnWidth((short) 0, (short) (256 * 25));
    spreadSheet.setColumnWidth((short) 1, (short) (256 * 25));
    // Creating Rows
    HSSFRow row = spreadSheet.createRow(0);
    HSSFCell cell = row.createCell((short) 1);
    cell.setCellValue("Year 2005");
    cell = row.createCell((short) 2);
    cell.setCellValue("Year 2004");
    HSSFRow row1 = spreadSheet.createRow(1);
    HSSFCellStyle cellStyle = wb.createCellStyle();
    cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);
    cell = row1.createCell((short) 0);
    cell.setCellValue("Revenue ($)");
    cell = row1.createCell((short) 1);
    cell.setCellValue("25656");
    cell = row1.createCell((short) 2);
    cell.setCellValue("15457");
    FileOutputStream output = new FileOutputStream(new File("/tmp/Users.xls"));
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment;filename=Users.xls");
    ServletOutputStream out = response.getOutputStream();
    wb.write(output);
    output.flush();
    output.close();
    forward = null;
    In firefox i get the download dialog box but not able to open in from there,i need to save it and then open. In IE i dont get the dialog box instead the excell open inside the browser......Please help me to open a excel sheet onclick on a link "Export to excel" in jsp......
    Thanks in advance...

  • Excel file download in jsp

    Hi,
    Is it possible to download excel file on the server on a JSP page. Kindly advice.
    Thanks in advance.

    yes...
    What is the scenario....
    is it..
    1. You have a XLS on server...alredy created..
    2. Now you need a link on JSP page....that is linked to this EXS file...
    3. User acess your web application and click on link....
    4. A popup comes up....and user selects either to save or download the file....
    Is this your scenario....
    If not then specify steps you are looking for....and you face issue in which step....
    Edited by: Saurabh Agarwal on Jul 6, 2011 12:21 PM

  • Garbage characters in excel file opened by jsp

              I am storing an excel file as blob in database. While retrieving
              from database when I open in the jsp page , it shows a lot of garbage characters
              and all formatting is lost. I am using content type "application/vnd.ms-excel".
              I am also setting correct mime type in web.xml as application/excel. It is weblogic
              6.1 sp2 with oracle 8.1.6. the pdf and word docs are working well. Please help
              soon.
              Thanks
              

    Download the Open G Toolkit from www.openg.org. There is a VI called Quit Application.vi that works great. I have used it with the very stupid Brooks 0154 SmartDDE Controller program to reset the application.
    Be sure to save the document and close the DDE communication first.
    Michael
    www.abcdefirm.com
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • Open an excel file in a jsp

    using apache poi excel, i created a workbook and add that into the season and opened in new jsp by servletoutputstream(these are happening at onclick).
    first time it's working fine,
    if i try do it again without closing this jsp, I am getting the same results in the previous jsp.But this works fine if i close the the jsp and do that.
    regards
    Senthil Arjunan

    duffymo wrote:
    SoulTech2012 wrote:
    duffymo wrote:
    That's fine, but you can serve up an Excel file (for download) with a couple lines of code. That doesn't require Spring. Too often I see these noobs working on a web project and throwing half a dozen frameworks at it because people told them to or recommended them. Noobs don't often know better and I have no doubt that some of them would attempt to use Spring just to get an Excel file to download if they were told to. But then again, that's their problem I guess.You win. What did I win?The debate, of course.
    Do you realize how often this question is asked and how many times the code has been posted?! No, which is why I asked. Please post them just one more time.Nobody likes a smart@ss. I seriously doubt, as much time as you spend here, that you truly believe that. Yes, I'm calling you a liar.
    >
    Besides, I have no interest in helping to set a precident that there's no need to do any research when you can simply ask for a handout here. Posting the code, or not, is still a better response than recommending Spring.Fine. Post the code.
    %knock yourself out!
    in 60 seconds I found a half dozen posts of the same exact code
    http://search.sun.com/search/onesearch/index.jsp?qt=download+excel+file&rfsubcat=&col=developer-forums&cs=false&rt=true&reslang=en

  • How to Downlaod a Excel file using FTP- -JSP

    Hi..i am dynamically generating excel file(i.e...writing into the excel file from Acees databse after executing the queries on it)...i have set the content-type to vnd-msexcel ....now i want that file to be downlaoded using FTP...FTP is new to me...any help could be greatly appreciated...
    Thanks in advance....

    JavaWorld published an article about this topic. It is called "Java FTP client libraries reviewed" and it can be found here :
    http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html
    Best regards
    Jean-Pierre Norguet
    Jean-Pierre Norguet
    JavaWorld Press
    http://wasa.ulb.ac.be/jp.html

  • I solved excel file  download from jsp or javabean

    first jexcel api download
    i used the jexcel api
    here sample ; using jexcel api
    This code is servlet
    ==================================================================
    SaleAgent sa = null;
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    // get Sale List DB Agent Class
    // you are modify
    sa = new SaleAgent();
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws IOException, ServletException {
    res.setContentType("application/vnd.ms-excel");
    res.setHeader("content-disposition", "attachment; filename=datesale.xls");
    // to get Sale List Parameter
    // you are modify
    String biz_id = req.getParameter("biz_id");
    String begindate = req.getParameter("begindate");
    String enddate = req.getParameter("enddate");
    // send parameter , set Parameter to get Data List from Database
    // you are modify
    sa.processDaySale(biz_id, enddate);
    ServletOutputStream out = res.getOutputStream();
    try {
    WritableWorkbook workbook = Workbook.createWorkbook(out);
    WritableSheet sheet = workbook.createSheet("datesale", 0);
    // head cell
    WritableCellFormat cf = new WritableCellFormat();
    cf.setAlignment(Alignment.CENTRE);
    cf.setBackground(Colour.LIGHT_GREEN);
    cf.setWrap(true);
    // data cell
    WritableCellFormat cf2 = new WritableCellFormat();
    cf2.setAlignment(Alignment.CENTRE);
    cf2.setWrap(true);
    // total cell
    WritableCellFormat cf3 = new WritableCellFormat();
    cf3.setAlignment(Alignment.CENTRE);
    cf3.setBackground(Colour.LIME);
    cf3.setWrap(true);
    // etc
    WritableCellFormat cf4 = new WritableCellFormat();
    cf4.setBackground(Colour.LIME);
    cf4.setWrap(true);
    // column width setting
    sheet.setColumnView(0, 10);
    sheet.setColumnView(1, 15);
    sheet.setColumnView(2, 15);
    sheet.setColumnView(3, 15);
    sheet.setColumnView(4, 15);
    sheet.setColumnView(5, 15);
    sheet.setColumnView(6, 15);
    sheet.setColumnView(7, 15);
    // head row setting
    Label label = new Label(0, 0, "NO.", cf);
    sheet.addCell(label);
    label = new Label(1, 0, "sale_date", cf);
    sheet.addCell(label);
    label = new Label(2, 0, "week", cf);
    sheet.addCell(label);
    label = new Label(3, 0, "total_sale", cf);
    sheet.addCell(label);
    label = new Label(4, 0, "net_sale", cf);
    sheet.addCell(label);
    label = new Label(5, 0, "cash", cf);
    sheet.addCell(label);
    label = new Label(6, 0, "card", cf);
    sheet.addCell(label);
    label = new Label(7, 0, "merch_bond", cf);
    sheet.addCell(label);
    // data row setting
    int t_total = 0;
    int t_net = 0;
    Number number = null;
    int maxRow = sa.getCount();
    for(int i = 0; i < maxRow; i++) {
    int t_sales = sa.getTotal_Sales_Price(i);
         int n_sales = sa.getTotal_Sales_Price(i) - sa.getTotal_Dc_Price(i);
    number = new Number(0, i+1, i + 1, cf2);
    sheet.addCell(number);
    label = new Label(1, i+1, sa.getSale_Time(i), cf2);
    sheet.addCell(label);
    number = new Number(2, i+1, t_sales);
    sheet.addCell(number);
    number = new Number(3, i+1, sa.getTotal_Dc_Price(i));
    sheet.addCell(number);
    number = new Number(4, i+1, n_sales);
    sheet.addCell(number);
    number = new Number(5, i+1, sa.getCash(i));
    sheet.addCell(number);
    number = new Number(6, i+1, sa.getCredit_Card(i));
    sheet.addCell(number);
    number = new Number(7, i+1, sa.getMerch_bond(i));
    sheet.addCell(number);
    t_total = t_total + t_sales;
    t_net = t_net + n_sales;
    // total row setting
    label = new Label(0, maxRow + 2, "", cf4);
    sheet.addCell(label);
    label = new Label(1, maxRow + 2, "Total : ", cf3);
    sheet.addCell(label);
    number = new Number(2, maxRow + 2, t_total, cf4);
    sheet.addCell(number);
    label = new Label(3, maxRow + 2, "", cf4);
    sheet.addCell(label);
    number = new Number(4, maxRow + 2, t_net, cf4);
    sheet.addCell(number);
    label = new Label(5, maxRow + 2, "", cf4);
    sheet.addCell(label);
    label = new Label(6, maxRow + 2, "", cf4);
    sheet.addCell(label);
    label = new Label(7, maxRow + 2, "", cf4);
    sheet.addCell(label);
    workbook.write();
    workbook.close();
    } catch(JXLException e) {
    e.printStackTrace();

    humm
    may be servlet link's target have to hidden frame
    i don't know correctly reason...

  • Opening an excel file in jsp

    how do you open an excel file in my jsp and target it to a table?

    can't it be done using the file class?
    i just want to open the excel file, that's all--
    Open means what ?
    See if this is useful
    String myDB =  "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=c:/book.xls;"
        + "DriverID=22;READONLY=false";
    //con=DriverManager.getConnection("jdbc:odbc:myExcel");
    con=DriverManager.getConnection(myDB,"","");
    dbmd=con.getMetaData();
    stat=con.createStatement();
    rs=stat.executeQuery("Select * from `Sheet1$`");//[Sheet1$]--
    I think it is not possible with File class. and if it is so
    then how you are going to handle the data ?

  • Exception while creating a excel file in BPM 10g

    Hi,
    We are facing following issue while creating an excel file from BPM.
    java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at fuegoblock.net.web.NewJspAjaxController.processMethodInvocation(NewJspAjaxController.java:264) at fuegoblock.net.web.NewJspAjaxController.service(NewJspAjaxController.java:46) at fuego.web.execution.servlet.ServletRedirector$ControllerRedirector.forward(ServletRedirector.java:197) at fuego.web.execution.servlet.ServletRedirector.redirect(ServletRedirector.java:58) at fuego.web.papi.TaskExecutor.processRedirect(TaskExecutor.java:224) at fuego.web.papi.TaskExecutor.execute(TaskExecutor.java:104) at fuego.workspace.servlet.ExecutorServlet.doAction(ExecutorServlet.java:117) at fuego.workspace.servlet.BaseServlet.doPost(BaseServlet.java:229) at fuego.workspace.servlet.BaseServlet.doGet(BaseServlet.java:220) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at fuego.workspace.servlet.AuthenticatedServlet.service(AuthenticatedServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at fuego.web.filter.SingleThreadPerSessionFilter.doFilter(SingleThreadPerSessionFilter.java:64) at fuego.web.filter.BaseFilter.doFilter(BaseFilter.java:63) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at fuego.web.filter.CharsetFilter.doFilter(CharsetFilter.java:48) at fuego.web.filter.BaseFilter.doFilter(BaseFilter.java:63) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) Caused by: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook at xobject.Views.ReportingView.exportToExcel(ReportingView.xcdl:9) ... 35 more Caused by: java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 36 more
    There is a JSP file which invokes the method of BPM, which inturn creates a excel file.
    In JSP we are calling the method in the following way:
    function exportSelectedItemsToExcel(){
         var url="<f:invokeUrl var='reportingView' methodName='exportToExcel'/>";
         url = url + "&bpmRespContentType=application/vnd.ms-excel";
         var windowHandle = window.open(url,'windowName','width=800, height=600, resizable=1, menubar=1');
    POI jars are used to create the excel.
    Also we recently did the migration and applied a patchset of 10.3.3 on 10.3.2. In the previous verison(10.3.2) it was working perfectly fine. When i am trying to test it on localstudio, it is generating the excel file properly.
    Have any one faced any such issues while migration or any other time?

    Manifests are saved with the .mf file extension. Rename your manifest mainfest.mf.

  • Problem in creating Excel file

    Dear all,
    i have occured aproblem while creating an Excel file while using JSP.
    in my jsp file i have given the two codes of line:
    <%
    response.setContentType("application/vnd.ms-excel");
    response.addHeader("Content-Disposition", "attachment");
    %>
    which creates an Excel file..But in my JSP File, i have some code using java Script. now , after creating the Excel File sucessfully, the jsp page is open but the JavaScript is not working .
    what might be the problem ..
    like in "one.jsp" i have the code to call "two.jsp" in which the above code is written. so in my calling jsp page ie., "one.jsp" once i call the "two.jsp" the Excel file is created sucessfully, and the page "one.jsp" is displayed as it is, but the javaScript in it is not working again..
    please do the need full.
    Thanks in Advance.
    Reagards
    Chandu

    Dear all,
    i have occured aproblem while creating an Excel file while using JSP.
    in my jsp file i have given the two codes of line:
    <%
    response.setContentType("application/vnd.ms-excel");
    response.addHeader("Content-Disposition", "attachment");
    %>
    which creates an Excel file..But in my JSP File, i have some code using java Script. now , after creating the Excel File sucessfully, the jsp page is open but the JavaScript is not working .
    what might be the problem ..
    like in "one.jsp" i have the code to call "two.jsp" in which the above code is written. so in my calling jsp page ie., "one.jsp" once i call the "two.jsp" the Excel file is created sucessfully, and the page "one.jsp" is displayed as it is, but the javaScript in it is not working again..
    please do the need full.
    Thanks in Advance.
    Reagards
    Chandu

  • Another question about import/export to excel file?

    Hi, I need to know urgently if it's possible to import/export excel files from/to JSP with unpredicted number of fields each row. For example, row 1 in the excel file can have 5 columns of data, row 2 has 3 columns of data, etc...
    Does reading from excel file in JSP require that we know beforehand how many columns there are and what each column represent?

    go read http://jakarta.apache.org/poi !!!!!!
    No it doesnt. the POI api provide method to determine the number of cells in a row.

  • How to Create Excel File in Background processing with different colors

    HI All
    I am trying to create Excel file in background & send it to user through e-mail, this i could acheive using fucntion module SO_DOCUMENT_SEND_API1, but here my requirement is i want to put different colors to columns of excel & this should happen in Background processing,
    Initially i completed above requirement by using HTML type of document with attachment type 'ALI'  & formatted output using write statement & used colors, after that i took this o/p using save_list function module & then table compress...etc.
    but i don't know how to achieve same if we need o/p in excel as size of object of excel file is less than that of HTML
    I am thankfull to everybody who will help me.
    Regards
    Lokesh

    Lokesh,
    Iam also trying to populate my text file with colors as an attachment . If you know this please let me know.

  • Read an excel file using JSP in MII 12.1

    Hi,
    I want to read an excel file using jsp page. I dont want to use the UDS or ODBC for connecting to excel.
    I am trying to use org.apache.poi to read the excel file in jsp page.
    While running, its showing a compilation error "package org.apache.poi.hssf.usermodel does not exist"
    I have the jar files for it, where do we need to upload it so that jsp page works.
    Thanks a lot
    Regards,
    Neha Maheshwari

    The user doesn't want to save the excel file in server.
    I want to upload file and save its contents in database.
    I have the code to read and save excel data in database but not able to get the location to deploy the jar file.
    In general, if we are creating a jsp page in MII workbench which is using some jar file.
    Whats the location to upload this jar file so that the jsp page works correctly?

  • I would like to upload a excel file using jsp

    Hi,
    I would like to upload the excel file using jsp in my netbeans ide. Please help.
    I don Know what is the error in this jsp file. It is not showing any thing and the file is also not getting uploaded.
    Please gothru the code below.
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ page import="java.io.*" errorPage="err.jsp"%>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="<html:rewrite page="/design.css" />" rel="stylesheet" type="text/css">
    <title>Upload Page</title>
    </head>
    <body onKeyDown="DisablingBackFunctionality()" onLoad="DisablingBackFunctionality()">
    <html:form action="download" >
    <div style="position:absolute; left:100;top:200;">Select an excel File :<input type="file" name="uploadfile"></div>
    <div style="position:absolute; left:190;top:250;"><input type="submit" name="Submit" value="Read"></div>
    <div style="position:absolute; left:336;top:250;"><input type="reset" name="Reset" value="Clear"></div>
    mainmenu
    </html:form>
    </body>
    </html>
    <%
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength) {
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String file = new String(dataBytes);
    //out.println("<br> file :"+file);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    //out.println("<br> savefile :"+saveFile);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    //out.println("<br> now file1 :"+saveFile);
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1, saveFile.indexOf("\""));
    //out.println("<br> now file2 :"+saveFile);
    //out.print(dataBytes);
    String ext = "";
    if (saveFile.indexOf(".") != -1) {
    ext = saveFile.substring(saveFile.lastIndexOf("."));
    int lastIndex = contentType.lastIndexOf("=");
    //out.println("<br>lst index of"+lastIndex);
    String boundary = contentType.substring(lastIndex + 1, contentType.length());
    //out.println("<br> boundary"+boundary);
    //out.println("<br> file :"+file);
    int pos;
    pos = file.indexOf("filename=\"");
    //out.println("<br> now 0 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 1 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 2 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 3"+pos);
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    FileOutputStream fileOut = new FileOutputStream("D:\\" + saveFile);
    //FileOutputStream fileOut = new FileOutputStream(saveFile);
    //fileOut.write(dataBytes);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    session.setAttribute("fil", saveFile);
    //out.println("File saved as " +saveFile);
    %>
    <script type="text/javascript" >
    function DisablingBackFunctionality()
    var URL;
    var i ;
    var QryStrValue;
    URL=window.location.href ;
    i=URL.indexOf("?");
    QryStrValue=URL.substring(i+1);
    if (QryStrValue!='X')
    window.location=URL + "?X";
    </script>
    Please let me know the result as soon as possible. Its my very urgent.
    Thanking Yu,
    Muthu Kumar.R

    No.
    Mylenium

Maybe you are looking for