I'm trying to send multiple files (pdf) from the device to the server, but is sent only last on the list !
Will you help me figure out where I'm wrong?
Client Code:
Thank you
Will you help me figure out where I'm wrong?
Client Code:
B4X:
Dim aListFile As List = File.ListFiles( aPath )
Dim aFileName As String
Dim aFileSize As Int
If aListFile.IsInitialized Then
For i = 0 To aListFile.Size -1
aFileName = aListFile.Get(i)
Dim aExist As Boolean = File.Exists(aPath, aFileName)
If aExist Then
aFileSize = File.Size(aPath, aFileName)
Log("File Name : " & aFileName & " Size: " & aFileSize)
Dim out As OutputStream
out.InitializeToBytesArray(aFileSize)
Dim In As InputStream = File.OpenInput(aPath, aFileName)
File.Copy2(In, out)
out.Close
In.Close
Dim su As StringUtils
j.PostBytes(aLink & "?type=ticket&filename=" & su.EncodeUrl(aFileName, "UTF8"), out.ToBytesArray)
End If
Next
End If
Thank you