Reputation: 4472
I am working on a download manager, that will support http/https/ftp protocols. I am using FTPClient
from the Apache commons library
to download files via FTP. I want to be able to determine the MIME-Type
of the file that is about to be downloaded. Please note that I know how to use the retrieveFile
method from FTPClient
. I just want to get MIME-Type
of file like audio/wma
.
Could any one please guide me to get this ?
Thanks in advance
Upvotes: 3
Views: 1227
Reputation: 6018
Well, you won't be able to get the MIME type of a file using FTP commands as it's not supported, therefore FTPClient
has no support to provide that information. However, after you've downloaded the file you can use org.apache.sling.commons.mime
to get the MIME type.
Upvotes: 3