How open a selected file using Java Servlet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SelvaSA
    New Member
    • Feb 2007
    • 7

    How open a selected file using Java Servlet

    Hi All,

    I can able to create a excel file using POIFS plug-in from Jakarta, but i want open already created file from a selected location.

    Here i am pasting my code to generate excel file.

    esponse.setCont entType("applic ation/vnd.ms-excel");
    PrintWriter out = response.getWri ter();
    String filepath="E:/share/PAR.xls";
    response.setHea der("Content-Disposition", "attachment ; filename="+file path+";");
    HSSFWorkbook wb = new HSSFWorkbook();
    FileOutputStrea m fileOut = new FileOutputStrea m("E/share/ISO-PAR.xls");
    wb.write(fileOu t);
    fileOut.close() ;
    out.close();

    Please anyone suggest me, how to open a file from selected location from browser.

    Regards,
    Selva
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by SelvaSA
    Hi All,

    I can able to create a excel file using POIFS plug-in from Jakarta, but i want open already created file from a selected location.

    Here i am pasting my code to generate excel file.

    esponse.setCont entType("applic ation/vnd.ms-excel");
    PrintWriter out = response.getWri ter();
    String filepath="E:/share/PAR.xls";
    response.setHea der("Content-Disposition", "attachment ; filename="+file path+";");
    HSSFWorkbook wb = new HSSFWorkbook();
    FileOutputStrea m fileOut = new FileOutputStrea m("E/share/ISO-PAR.xls");
    wb.write(fileOu t);
    fileOut.close() ;
    out.close();

    Please anyone suggest me, how to open a file from selected location from browser.

    Regards,
    Selva
    Read this .

    Comment

    • SelvaSA
      New Member
      • Feb 2007
      • 7

      #3
      I can able open a file from selected location.I want edit ,but I can't due to file is opened at background .As default ,this opens a excel with empty file. If i am saving opened file, that is opened file from selected one.

      Anyone help me out, how edit a opened file.

      Regards,
      Selva

      Comment

      • hidash
        New Member
        • Mar 2008
        • 7

        #4
        Hi selvasa,
        can u send ur code. then only i can give u a good solution for ur problem. i am doing the same. so syrely i will help you.


        Regards
        hidashkumar..

        Comment

        • minalkapoor
          New Member
          • Mar 2008
          • 1

          #5
          Hi can you give me the source code for oprning he excel sheet from Java code..., from a specified location.

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by minalkapoor
            Hi can you give me the source code for oprning he excel sheet from Java code..., from a specified location.
            We don't give out boiler plate source codes here.
            See our posting guidelines

            Comment

            Working...