I have an HTML form which has a multiple file upload element.
The form handles the multiple files fine and I can see its picked up all the files selected.
However on the server side I only see the first file.
Has anyone been able to handle multi-file uploads?
Here is a code snippet;
B4X:
<input type="file" name="files[]" id="files" multiple="" accept="image/*" onchange="fileinfo()">
The form handles the multiple files fine and I can see its picked up all the files selected.
However on the server side I only see the first file.
Has anyone been able to handle multi-file uploads?
Here is a code snippet;
B4X:
If req.ContentType.StartsWith("multipart/form-data;") Then 'multipart/form-data; boundary=----WebKitFormBoundaryAJalm1Gxe1sTTGcy
'parse the multipart data
Dim parts As Map = req.GetMultipartData(File.DirApp & "/www/uploads/", 10000000)
Log(parts.Size)
Dim Encoding As String = req.CharacterEncoding
Dim n As Int
For n = 0 To parts.Size-1
Log("Key = " & parts.GetKeyAt(n))
Log("Value = " & parts.GetValueAt(n))
Dim ThisPart As Part = parts.GetValueAt(n)
'Log(ThisPart.GetValue(Encoding))
If parts.GetKeyAt(n) = "files[]" Then
Log(ThisPart.SubmittedFilename)
End If
Next