A AllanH Member Licensed User Longtime User Oct 9, 2021 #1 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?
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?
M Mahares Expert Licensed User Longtime User Oct 9, 2021 #2 AllanH said: This suggests DownloadFile is not returning an object? Click to expand... I think you need True instead of false as the file is ASCII Code: Dim sf As Object = FTP.DownloadFile("Downloads.txt", True, xui.DefaultFolder, "downloads_new.txt") Upvote 0
AllanH said: This suggests DownloadFile is not returning an object? Click to expand... I think you need True instead of false as the file is ASCII Code: Dim sf As Object = FTP.DownloadFile("Downloads.txt", True, xui.DefaultFolder, "downloads_new.txt")
Erel B4X founder Staff member Licensed User Longtime User Oct 10, 2021 #3 It looks like you are using an old version of Net.jar. Make sure that there is no old copy in the internal libraries folder. Latest version is available here: https://www.b4x.com/android/forum/threads/new-net-library-android-ftp-smtp-and-pop3.10892/#content Upvote 0
It looks like you are using an old version of Net.jar. Make sure that there is no old copy in the internal libraries folder. Latest version is available here: https://www.b4x.com/android/forum/threads/new-net-library-android-ftp-smtp-and-pop3.10892/#content