I searched in many threads but couldn't find how to do the sequence:
- POST a form with some token or even username and password, plus a file.
- IF token or username/password is valid, then the file (.csv) must to be written in a specific directory
I already tested cresting a html form and a php scrit those worked very well using browser, but didn't triggered the POST event when called using Job.PostMultipart ... the code that I used is:
Dim Job As HttpJob
Dim Param As Map
Dim Arqs As MultipartFileData
Arqs.Initialize
Param.Initialize
Job.Initialize("Contacts_Sent",Me)
Param.Put("username",Username)
Param.Put("password",Password)
Arqs.KeyName = "contacts"
Arqs.Dir = File.DirInternal
Arqs.ContentType = "text/csv"
Arqs.FileName = "contacts.csv"
Job.PostMultipart("
https://myserver/uploadfile.html",Param,Array(Arqs))
In jobdone event I got only the html content of site - what means that the POST method wasn't sent ...
I noticed that I can use php://input and parse the raw data received but couldn't find also any parse script sample that is compatible with postmultipart encoding of b4a, meaning that this path will be very hard also... could anybody help me?