Reputation: 371
We are having issues where sometimes no error is thrown when a file is partially uploaded over FTP. For example, if we transfer an image only half of it will be transferred and then it will return without any error. I wanted to add a check so that after the file is transferred I will get the size of the file in the server and check if the size match.
This is fine when we are using binary transfer mode but when we use the ASCII transfer mode the size usually doesn't match even when the complete file is transferred. To avoid false negatives I wanted to add this check only when the transfer mode is BINARY
How can we get the file type with java Apache FTPClient, I could find methods only to set the file type but none to get the file type.
As a workaround I can execute the TYPE
command and parse the response, I wanted to know if there is an option in the client so that I don't have to maintain additional code.--> this doesn't work either, executing the TYPE
command I get a replay saying 501 Missing required argument
.
Edit: The code is part of our product and I can't force the users to always use binary mode.
Upvotes: 0
Views: 167