Refine getLength(file) method to work with ftp.