I’m using Apache’s commons-net-2.2.jar to download a batch of files from a FTP server, the files which list on FTP are gziped file and the PDFfile was in it, and all of these files can unzip and open correctly.
But, after download those files to my local, some of files can not be opened, it shows the message of “the file is broken” when I unziped the file, and finally the PDF file can not be opened correctly which will be showing the message of “Can not find the charset of *“.
I’m wondering what the root cause of this issue could be.
That sounds a bit strange. Check that you are specifically telling the FTP server that you want to use “binary” mode for the transfer.