Hi all,
I'm trying to send a file via PostMultiPart (I can't use FTP)
I sue this code:
B4X:
Dim j As HttpJob
j.PostMultipart(Main.ServerUrl, NV, files)
Wait for (j) JobDone(Response As HttpJob)
If Response.Success Then ' hc_ResponseSuccess
Log ("Risposta: " &Response.GetString)
Msgbox(Response.GetString, "")
Else ' hc_ResponseError, but without StatusCode
Log("Error : " & Response.ErrorMessage)
End If
Error occurred on line: 198 (Certificato)
java.lang.ClassCastException: com.mamavi.webfitness.multipartpost$_filedata cannot be cast to anywheresoftware.b4a.samples.httputils2.httpjob$_multipartfiledata
at anywheresoftware.b4a.samples.httputils2.httpjob._postmultipart(httpjob.java:383)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
The file exists.
I think error is in "files", because if i send without files I have no error