Hi Anil
If your only access is through FTP then you will have a problem :(
Unless you ofcourse can figure out something with the guy that own the
webserver, so you can install a java-program on the webserver.
Marios suggestion good enough, but if you have access to the server then you
can build your own app to do the same
I cant just remeber where i saw it, but try google after ftp transfer by
java, im sure it exists. I know it exists as an Applet
Bjarne Pedersen
--------------------------------------------------------------------------------
Med venlig hilsen / Best regards / Mit freundlichen GrĂ¼ssen IT-Ansvarlig
Bjarne Pedersen SCHMIEDMANN ODENSE Sandvadvej 9, Korup 5210 Odense NV Tlf.
+45 65 94 15 45 Fax +45 65 94 00 98 E-Mail [EMAIL PROTECTED] web
www.schmiedmann.com CVR. Nr. DK20549548
----- Original Message -----
From: "Anil Philip" <[EMAIL PROTECTED]>
To: "Jakarta Commons Users List" <[email protected]>
Sent: Wednesday, August 16, 2006 3:33 PM
Subject: Re: [commons-net ftp] how to ftp a zipped file and unzip it at the
other end?
Thank you for replying.
How do I upload and unzip?
ie. suppose that my only access to the machine is thru
commons-net ftp.
after some googling, I find that net2ftp has this
functionality, but apparently manually from a web
page. Does one need to also telnet?
thanks,
Anil
--- Bjarne Pedersen / Schmiedmann
<[EMAIL PROTECTED]> wrote:
Hi Anil
I have this snippet (dont if it work, have not tryed
it)
import java.io.*;
import java.util.zip.*;
public class UnZip {
final int BUFFER = 2048;
public static void main (String argv[]) {
try {
BufferedOutputStream dest = null;
FileInputStream fis = new
FileInputStream(argv[0]);
ZipInputStream zis = new
ZipInputStream(new BufferedInputStream(fis));
ZipEntry entry;
while((entry = zis.getNextEntry()) != null)
{
System.out.println("Extracting: "
+entry);
int count;
byte data[] = new byte[BUFFER];
// write the files to the disk
FileOutputStream fos = new
FileOutputStream(entry.getName());
dest = new
BufferedOutputStream(fos, BUFFER);
while ((count = zis.read(data, 0,
BUFFER))
!= -1) {
dest.write(data, 0, count);
}
dest.flush();
dest.close();
}
zis.close();
} catch(Exception e) {
e.printStackTrace();
}
}
}Bjarne
Pedersen--------------------------------------------------------------------------------
Med venlig hilsen / Best regards / Mit freundlichen
GrĂ¼ssen IT-Ansvarlig
Bjarne Pedersen SCHMIEDMANN ODENSE Sandvadvej 9,
Korup 5210 Odense NV Tlf.
+45 65 94 15 45 Fax +45 65 94 00 98 E-Mail
[EMAIL PROTECTED] web
www.schmiedmann.com CVR. Nr. DK20549548
----- Original Message -----
From: "Anil Philip" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, August 16, 2006 3:09 PM
Subject: [commons-net ftp] how to ftp a zipped file
and unzip it at the
other end?
Hello,
I have an html file and its associated folder on a
Windows desktop. e.g. myPage.html and myPage_files.
I
need to save it remotely to a Linux machine. So I
use
ftp. However it is inefficient to transfer each file
across piecemeal.
I was thinking it might be smarter to zip it up and
ftp it across.
Qs. How do I unzip it at the other end?
(of course, this is done by my program, not
manually).
thanks,
Anil
for good news go to
http://members.tripod.com/~goodnewsforyou/goodnews.html
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]