I have a FileChooser which is set to ShowOpenMultiple() and returns the files to a list. However, I'm unsure how to handle the list items in the File.Copy or File.Copy2 methods due to each needing a directory.
Sub GetFileName(fullpath As String) As String
Dim i As Int = fullpath.LastIndexOf("\")
If i = -1 Then i = fullpath.LastIndexOf("/")
If i = -1 Then Return fullpath
If i = fullpath.Length - 1 Then Return ""
Return fullpath.SubString(i + 1)
End Sub
B4X:
Dim files As List = fc.ShowOpenMultiple(MainForm)
If files.IsInitialized Then
For Each f As String In files
File.Copy(f, "", <target>, GetFileName(f))
Next
End If