Android Question ftp.DownloadFile incompatible types

AllanH

Member
Licensed User
Longtime User
I'm trying to get ftp downloading working as a backup if http fails (as happened when I move server and didn't have ssl setup).
I'm using the net library 1.81
I've initialised the FTP object and compile but the compiler fails on the following line
B4X:
Dim sf As Object = FTP.DownloadFile("Downloads.txt", False, xui.DefaultFolder, "downloads_new.txt")
with the error:

Compiling generated Java code. Error
B4A line: 275
Dim sf As Object = FTP.DownloadFile(\
src\bse\echocalc\assetsmanager.java:364: error: incompatible types: void cannot be converted to Object
_sf = __ref._ftp /*anywheresoftware.b4a.net.FTPWrapper*/ .DownloadFile(ba,"Downloads.txt",parent.__c.False,__ref._xui /*anywheresoftware.b4a.objects.B4XViewWrapper.XUI*/ .getDefaultFolder(),"downloads_new.txt");

This suggests DownloadFile is not returning an object?
 

Mahares

Expert
Licensed User
Longtime User
This suggests DownloadFile is not returning an object?

I think you need True instead of false as the file is ASCII
B4X:
Dim sf As Object = FTP.DownloadFile("Downloads.txt", True, xui.DefaultFolder, "downloads_new.txt")
 
Upvote 0
Top