Sub uploadImagem (filename As String, dir As String)
Dim j As HttpJob
Dim img As String = filename
j.Initialize("", Me)
Dim mp As MultipartFileData
mp.Initialize
mp.Dir = dir
mp.FileName = img
mp.KeyName = "foto"
mp.ContentType = "image/jpg"
Dim map As Map = CreateMap("id_os": 3, "etapa": "INICIO")
j.PostMultipart(host&"api/funcionario/enviarFoto", map, Array(mp))
j.GetRequest.SetHeader("Authorization","token")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim parser As JSONParser
parser.Initialize(j.GetString)
Dim jRoot As Map = parser.NextObject
Dim Success As String = jRoot.Get("Success")
Dim Erro As String = jRoot.Get("Erro")
If Success = "Foto enviada" Then
CONFIG_STYLE.mostrarToastMessage(Root, Success)
' carregarOS
Else
CONFIG_STYLE.mostrarToastMessage(Root, Erro)
End If
End If
j.Release
End Sub