I want to upload a zip file to the server using FTP protocol.
1. What is the best way to zip my files using java?
2. Later on I want to unzip the file in the server. How can I do it with FTP and java?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
GZipStreamclasses (GZipOutputStream and GZipInputStream) should take care of the compression part. You can take a look here to see how you can compress files and this tutorial to uncompress the file. To upload the file through the use of FTP you can use Apache’s FTPClient.