Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.6k views
in Java FTP by (200 points)
Hi,
What should be the connection mode and transfer method to ftp a pdf file?

Thanks,
Ajay.

3 Answers

0 votes
by (200 points)
Hi,
I tried with ASCII mode (FTPTransferType.ASCII) and it works. However the same code is not working in the app server environment. I am not sure if it is a right approach to transfer PDF files in ASCII mode. Please throw some light on this.

Also please let me know can I transfer text files in binary mode? (.txt files, .jpg files, .sql files etc)
0 votes
by (162k points)
You must transfer PDF files in BINARY mode. Similarly for all multimedia files. They will corrupted if you use ASCII mode.

setType(FTPTransferType.BINARY);

Call the above before calling put() or get()

You can transfer text files in binary mode, but if the server is Unix and you are on Windows files transferred may look weird in Notepad.
0 votes
by (200 points)
Thank You Bruce.

Categories

...