I need to upload images to a web site, along with additional information such as Title, etc...
I'm using the HttpUtils, and the application is crashing..
I am reading the file in, convert it to Base64, and doing a PostString.
Here is the code I am using to read the image in, and convert it to Base64.
however, as soon as that is complete, and it tries to execute the next line of code, the application gets an error "The application <name> (Process <name>) has stopped unexpectedly. Please try again".
Two questions...
1) Is that code correct for converting the file to Base64 string?
2) Is there a better way to upload a file with additional data?
Thanks!
I'm using the HttpUtils, and the application is crashing..
I am reading the file in, convert it to Base64, and doing a PostString.
Here is the code I am using to read the image in, and convert it to Base64.
B4X:
inStream = File.OpenInput(photoPath, cur.GetString("PhotoFilename"))
Dim buff(inStream.BytesAvailable) As Byte
inStream.ReadBytes(buff, 0, inStream.BytesAvailable)
tempVal = su.EncodeBase64(buff)
however, as soon as that is complete, and it tries to execute the next line of code, the application gets an error "The application <name> (Process <name>) has stopped unexpectedly. Please try again".
Two questions...
1) Is that code correct for converting the file to Base64 string?
2) Is there a better way to upload a file with additional data?
Thanks!