gapi Active Member Licensed User Longtime User May 21, 2012 #1 Some examples of how to make a comparison between a folder on FTP and one in sd? For upgrade same images in my app ... thanks p.s. I already know a little library NET
Some examples of how to make a comparison between a folder on FTP and one in sd? For upgrade same images in my app ... thanks p.s. I already know a little library NET
kanaida Active Member Licensed User Longtime User May 22, 2012 #2 Not sure if the ftp library lists folder contents with dates, but that would be the way to go. An asp.net http handler would work better though, as you can format it easily and have parameters. I'd pass it the last date+time of your images and get. Net to return you images modified > that date+ time as a string. Then parse the string in b4a with regex.Split and download those img urls. Sent from my LG-MS840 using Tapatalk 2 Upvote 0
Not sure if the ftp library lists folder contents with dates, but that would be the way to go. An asp.net http handler would work better though, as you can format it easily and have parameters. I'd pass it the last date+time of your images and get. Net to return you images modified > that date+ time as a string. Then parse the string in b4a with regex.Split and download those img urls. Sent from my LG-MS840 using Tapatalk 2
lagore Active Member Licensed User Longtime User May 22, 2012 #3 The only problem with using the date/time option is if the ftp server is in a different time zone or set to UTC then if it is ahead of your location when you download the file its local created time will still be older then the server one. Upvote 0
The only problem with using the date/time option is if the ftp server is in a different time zone or set to UTC then if it is ahead of your location when you download the file its local created time will still be older then the server one.
gapi Active Member Licensed User Longtime User May 23, 2012 #4 Hi all thanks for comments here a sample of library on work ... (List files and folders) Upvote 0
gapi Active Member Licensed User Longtime User May 23, 2012 #5 what command for copy from FTP to SD ? I try with File.copy() but first parameter is a Dir ... not a FTP ! tnx Upvote 0
what command for copy from FTP to SD ? I try with File.copy() but first parameter is a Dir ... not a FTP ! tnx
lagore Active Member Licensed User Longtime User May 24, 2012 #6 When you use ftp download Code: MyFTP1.DownloadFile("Myserver",False,File.DirRootExternal,"MyNewSavedFile") you can specify where to save the file, in the above example it is saved to the external sd card. Upvote 0
When you use ftp download Code: MyFTP1.DownloadFile("Myserver",False,File.DirRootExternal,"MyNewSavedFile") you can specify where to save the file, in the above example it is saved to the external sd card.
gapi Active Member Licensed User Longtime User May 24, 2012 #7 thanks lagore, but if I must execute two separate downloads .... it repeat "Download_Completed_Sub", there is a solution to differentiate the various download? tnx Upvote 0
thanks lagore, but if I must execute two separate downloads .... it repeat "Download_Completed_Sub", there is a solution to differentiate the various download? tnx
lagore Active Member Licensed User Longtime User May 24, 2012 #8 You have a couple of options depending on whether the download is coming from different servers or not. If the different downloads come from different servers then Code: MyFTP1_DownloadCompleted (ServerPath As String, Success As Boolean) the 'ServerPath' can be used to differentiate between the different servers in the download sub to perform different actions, if it is the same server but different files with different actions once downloaded then define more ftp objects. Code: Dim MyFTP1 As FTP Dim MyFTP2 As FTP when you initilise them they can have different Event names this will direct the downloadCompleted to the different subs. Clear as mud I hope? Upvote 0
You have a couple of options depending on whether the download is coming from different servers or not. If the different downloads come from different servers then Code: MyFTP1_DownloadCompleted (ServerPath As String, Success As Boolean) the 'ServerPath' can be used to differentiate between the different servers in the download sub to perform different actions, if it is the same server but different files with different actions once downloaded then define more ftp objects. Code: Dim MyFTP1 As FTP Dim MyFTP2 As FTP when you initilise them they can have different Event names this will direct the downloadCompleted to the different subs. Clear as mud I hope?