Hi, using the library :
how to get the field name or id from a html submited?
on B4X
[B4X] xHttpServer (Http Server + jQuery)
It is a personal project of mine that I started as a hobby on B4i and it has become an interesting project, so that I have modified it to be multiplatform. It is an http server, which allows a browser to navigate on html pages stored on the device. In addition, dynamic pages can also be...
www.b4x.com
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