B4J Question FTP UploadFile problem

imbault

Well-Known Member
Licensed User
Longtime User
Hi,
Using FTP object, I've got a error

While, the same credentials and passive mode on FileZilla uploads like a charm,

Here is the code (simple)
B4X:
    cFile1="BAQ_liste_analyses_L14_S107_150710_112605.csv"
    Log( File.Exists(File.DirApp,cFile1))
    oFTP.Initialize("FTP", FTP_Server, 21, FTP_User, FTP_Password)
    oFTP.PassiveMode = True
    oFTP.UploadFile(File.DirApp, cFile1, True, "/"  )

Does anyone has an idea???
B4J V3.00
jNet Lib V 1.10
 

imbault

Well-Known Member
Licensed User
Longtime User
Thanks Erel, the problem was elsewhere as usual so, I post it, because it could help someone else:
FTP.UploadFile last parameter is ServerFilePath - Full path to file that will be created on the server.
In that case ServerFilePath must contain also the file created on the FTP target site

So working code (is that case) is:

B4X:
cFile1="BAQ_liste_analyses_L14_S107_150710_112605.csv"
    Log( File.Exists(File.DirApp,cFile1))
    oFTP.Initialize("FTP", FTP_Server, 21, FTP_User, FTP_Password)
    oFTP.PassiveMode = True
    oFTP.UploadFile(File.DirApp, cFile1, True, "/" & cFile1  )
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…