It began in the english Forum.
In the english part of the forum i wrote an ftp example for @schimanski a few days ago which uses a "FTP Download Queue". all files are put into a list and after that they are downloaded each one after another (using one download at the same time).
I have extended this example a little bit. Now it is first do a LIST-Command (list all files in a defined folder on FTP) and all files listed are put into the downloadqueue. After that all files from the queue are downloaded one after another.
I made some design-changes also.
label1 would be used to show progress of the downloaded files.
lv would be uses to show results of each file. Files downloaded without error are marked with a GREEN item. red marked items are the one where an error occurs.
There is one entry in downloadqueue which does not exists. I made this knowingly due to demonstrate such a situation.
If all files are downloaded (doesnt matter with or without errors) the following code gives you an overview over all made downloads.
Inside this you will find informations of each file
Attached you will find my small example. It´s optimizeable i´m sure (i´m still in learning-phase of B4A ) but it may help some of you finding a nice example i suppose.
In the english part of the forum i wrote an ftp example for @schimanski a few days ago which uses a "FTP Download Queue". all files are put into a list and after that they are downloaded each one after another (using one download at the same time).
I have extended this example a little bit. Now it is first do a LIST-Command (list all files in a defined folder on FTP) and all files listed are put into the downloadqueue. After that all files from the queue are downloaded one after another.
I made some design-changes also.
label1 would be used to show progress of the downloaded files.
lv would be uses to show results of each file. Files downloaded without error are marked with a GREEN item. red marked items are the one where an error occurs.
There is one entry in downloadqueue which does not exists. I made this knowingly due to demonstrate such a situation.
If all files are downloaded (doesnt matter with or without errors) the following code gives you an overview over all made downloads.
B4X:
For i = 0 To jobresults.Size -1
Log(jobresults.Get(i))
Next
All files have been downloaded
{Filename=54532324.jpg, Success=false, Exception=java.lang.RuntimeException: Error retrieving file.
550 /vdfb.de/fonts/54532324.jpg: No such file or directory
}
{Filename=DejaVuSans.ttf, Success=true, Exception=}
{Filename=VeraMoBd.ttf, Success=true, Exception=}
{Filename=VeraMono.ttf, Success=true, Exception=}
Attached you will find my small example. It´s optimizeable i´m sure (i´m still in learning-phase of B4A ) but it may help some of you finding a nice example i suppose.
Attachments
Last edited: