?
Solved

How to server automatically extract zip file which uploaded from client

Posted on 2004-09-16
3
Medium Priority
?
186 Views
Last Modified: 2010-03-31
My application is client/server model. I have a zip file. This zip file must be uploaded to server. How to after client upload to server successfully, server automatically extract that zip file.
0
Comment
Question by:software222
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
Javatm earned 150 total points
ID: 12077408
> How to after client upload to server successfully, server automatically extract that zip file.

This 2 links can help you out, or maybe give you a nice start :

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20274744.html
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20089536.html

Hope that helps . . .
Javatm
0
 
LVL 14

Assisted Solution

by:sudhakar_koundinya
sudhakar_koundinya earned 100 total points
ID: 12077820
try {
        // Open the ZIP file
        String inFilename = "infile.zip";
        ZipInputStream in = new ZipInputStream(new FileInputStream(inFilename));
   
        // Get the first entry
        ZipEntry entry = in.getNextEntry();
   
        // Open the output file
        String outFilename = "o";
        OutputStream out = new FileOutputStream(outFilename);
   
        // Transfer bytes from the ZIP file to the output file
        byte[] buf = new byte[1024];
        int len;
        while ((len = in.read(buf)) > 0) {
            out.write(buf, 0, len);
        }
   
        // Close the streams
        out.close();
        in.close();
    } catch (IOException e) {
    }
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question