val file = File(localFilePath)
val ftpClient = FTPClient()
ftpClient.connectTimeout = 100*1000
// ftpClient.connect(InetAddress.getByName(serverAddress))
ftpClient.connect(serverAddress)
ftpClient.login(userName, password)
ftpClient.enterLocalPassiveMode()
ftpClient.setFileType(FTP.BINARY_FILE_TYPE)
ftpClient.changeWorkingDirectory(folderPath)
val inputStream = FileInputStream(file)
success = ftpClient.storeFile(remoteFileName, inputStream)
inputStream.close()
This is my code to connect and upload image into the folder in server. result - unable to resolve host while trying in android but able to connect and push images into server through webclient.