I have a question, I want to send an image (in byte array), y have the image in memory, but i don't know how to send it, any idea?
I use
B4X:
in.InitializeFromBytesArray(Data, 0, Data.Length) 'image taken from the camera
query="dbe9c2450553009d47e6597a725250ca,<imagen>"& in &"</imagen>"
req.InitializePost2("http://xxx.xxx.xxx.xxx/recive_respuesta_webservice_json.php", query.GetBytes("UTF8"))
Sorry for no give an answer before, I try to use HttpUtils but it doesent work for me. But was a great example of codes so I fix my problemas (Just Today) so y want to shared with all of you, so some one with the same problema con fix it.
Has someone has an example of posting an image and receiving it at a VB.Net endpoint.
I have tried to send it via base64 encoded parameter, after reading the byte() array to string, but the VB.net endpoint tells me that the encoded string recieved at the server, mismatchs the base64 length.
I have tried to post the file, but the VB.Net endpoint, does not recieved the file.
Thanks Erel,
The main problem relies than PostFile does not include the enctype does not transmit like a "multipart/form-data", so on the other end I cannot recieve the "files" collection in order to save the chunks.
Is there a way that HTTPUtils can include the enctype?
Dim Ruta as String = server.MapPath("/files/check.list/" & request.QueryString("idItem") & ".jpg")
Dim stream as Stream = Request.InputStream
Using fileStream As FileStream = System.IO.File.Create(ruta, CInt(stream.Length))
Dim bytesInStream(0 To stream.Length - 1) As byte
stream.Read(BytesInStream, 0, CInt(bytesInStream.Length))
fileStream.Write(bytesInStream, 0, bytesInStream.Length)
End using