How to programmatically Zip a Directory on the Client achine?

Hi All,

I need to provide users an option to upload a folder.

Apache FileUpload API can upload only multiple files, but not folders.

So, I wish to zip the file the file programmatically on the client machine, and upload that zip file to the server, and then unzip the file at the server.

Besidesthis, I have to delete the zipped file both on the client machine and on the Server.

Is this a bad Idea?

Can anyone help how to achieve to achieve this?

Thanking you in advance,

Samba.

[535 byte] By [MasterJa] at [2007-10-3 6:45:57]
# 1

JSP can't do that for you.

The simplest thing to do is to tell the user to zip the folder up.

If you want to do it in Java, you will need a signed applet or some other client side application. The user would have to specifically download it and allow it access to the local machine.

The Java app would use java.util.zip.ZipOutputStream to write to the zip file.

stevejlukea at 2007-7-15 1:35:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thankyou Steve,I'm looking into other options.bye,Regards,Samba.
MasterJa at 2007-7-15 1:35:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi!Steve.Could you please give some hint on how to write an uploading applet?Thanking you,Smba.
MasterJa at 2007-7-15 1:35:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
The applet would use the HttpURLConnection object to send data to a page on the server.
stevejlukea at 2007-7-15 1:35:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...