Android Question how to get the name of a field on a html form using the httpserver library?

omarruben

Active Member
Licensed User
Longtime User
Hi, using the library :

how to get the field name or id from a html submited?
sample html:
<form id="form1" action="/FileUpload?id=1" method="post" enctype="multipart/form-data">
            <label for="file1">
                <img src="/menu1.jpg" class="icon">
                <input type="file" name="file1xxx" id="file1xxx" style="display:none;">
                <input type="submit" name="submit" value="Change">
            </label>
        </form>

on B4X
B4X:
If req.MultipartFilename.Size>0 Then
' need to know what file is beeing sent by name or id from the html form
        For Each Filename As String In req.MultipartFilename.Keys
            tempfilename=req.MultipartFilename.Get(Filename)
            OriginaleFileName=Filename
        Next
    End If
 
Top