B4A Library Automated FTP Library

Claudio57

Member
Licensed User
Longtime User
Hello Margret. I saw your library Automated FTP but I could not find the sample code. I am a beginner and I need to understand the example. Thank you.
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi Margret,

how do you connect to ur local host? i have xampp installed on my computer. Kindly let me know.

Regards,
SK
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi Margret,

I succeeded in transferring a file to the server however i am facing the below issues.

1. im using the following initialization code
B4X:
FTP.Initialize(Activity,Me,"ftp.xxx.com","fxxxx","xxxx",21,False,True)
FTP.SetStealthOn(True)
FTP.SetCompletedUploadDialog(True,"Files Uploaded Successfully")
but still the progress bar is shown when the file is uploaded to the server.

2. For uploading two or more files i am using
B4X:
FTP.UploadFileSet("",file_name,False)
where filename is an array containing the loacation of the files in the local. This is not working since i get an arrayindexoutofbounds exception. Should we define filename as array as string ("","") ?

Kindly let me know.

Regards,
SK
 

shashkiranr

Active Member
Licensed User
Longtime User
Thanks Margret,

Any idea how to Convert file_name() as string to Array as String ("","")

Regards,
SK
 

shashkiranr

Active Member
Licensed User
Longtime User
yes i have tried
B4X:
FTP.UploadFileSet("",file_name,False)
since file_name is defined as an Array of String but it is not working getting indexoutfbounds exception.
 

shashkiranr

Active Member
Licensed User
Longtime User
yes i get a warning saying object converted to string. this must be a programming mistake. should i still ignore the warning and go ahead??
 

margret

Well-Known Member
Licensed User
Longtime User
Yes, I would try it even with the warning. The function is looking for a string array to be passed to it. If your array is a string array, this should work without any problems. You can also test it by hard coding a few items just to test. You may also want to log the array elements right before this command, just to confirm what is in each element and it's size.
 

margret

Well-Known Member
Licensed User
Longtime User

As you have listed above, this is the correct format. I just did it in a project I am working on. So, we need to look for something else or something about the array that is causing this error. Make sure you don't have any other subs or variables named file_name. If file_name is built in another sub, it should also be a Global variable.
 
Last edited:

shashkiranr

Active Member
Licensed User
Longtime User
Hi Margret,

I tried () after file_name but not working. it gives a missing parameter error. Any workaround since i need to upload multiple files at once.

Regards,
SK
 

GMan

Well-Known Member
Licensed User
Longtime User
Hoi margret,
nice lib - would be nice if you update the 1st post with the 1.03 lib
 

GMan

Well-Known Member
Licensed User
Longtime User
De nada
Is there a way to combine file_mask and specified file ?

And if i try 1.05 my App crashes
 

GMan

Well-Known Member
Licensed User
Longtime User
It crashes with no error message but "App was ended".

OK, will have a look to the additinonal parameters...tried it (of course) only be changing the lib
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…