This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes file size issue when copying zip with commons net api Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "file size issue when copying zip with commons net api" Watch "file size issue when copying zip with commons net api" New topic
Author

file size issue when copying zip with commons net api

Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
hi,
i am using jakarta commons api to copy files from my computer to remote computer. i have two zip file and two tab files. The tab files are fine but the zip files copied over as less in size compared the original. is there any setting i need to do to the FTPClient so that the file size matches after it is copied. This is my code
fis = null;
fis = new FileInputStream("/syndi/ED_PIC_ENHANCED_N.zip");
ftp.storeFile("ED_PIC_ENHANCED_N_temp.zip",fis);
Any help
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Yes. You need to use BINARY mode for the transfer, something like this:
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Thanks a lot
it works
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: file size issue when copying zip with commons net api
 
Similar Threads
Zipping files using ZipOutputStream
How to write zip files into another zip file..?
UnZIPPing Exception
calling jasper reports from java
GZipInputStream & ZipInputStream?