Android Question Base64 conversion

FormCommander

Member
Licensed User
Longtime User
Hello,
I want to send an image and additional infos to my webserver with a HTTP job. I see that I can do this with PostFile. But here I cannot send the additional infos like with Download2 and the parameters. So I think the best way is to create a xml with the base64 encoded image and send it as file.
But converting this way does not work because of a casting error message:
B4X:
Dim cImgSend As Byte = FileToBytes(cPhotoDir,cPhotoFile)
        Dim b() As Byte = su.EncodeBase64(cImgSend)

I would try to put the encoded string in a xml field with XMLBuilder, can this make problems ? I think I must convert back to a string.
Or is there a better way to send the data in a http job ?
regards
Rudolf
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

FormCommander

Member
Licensed User
Longtime User
Thank you, works now. Have also successful compressed the xml and sent to my webserver. So problem solved.
regards
Rudolf
 
Upvote 0
Top