I am trying to communicate across the cloud with a file conversion site that has an API that allows conversion of files embedded within an XML file.
I am trying to send this via HTTPUtils.PostString, Their support is telling me that the file arriving is truncated, providing a corrupt image and therefore failing conversion. I just wanted to check before I spend too long investigating this, if there is a string size limit for use with HTTP.PostString.
The String I am trying to send is about 40kb including a Base64 encoded image.
The XML string is built like this:
I am trying to send this via HTTPUtils.PostString, Their support is telling me that the file arriving is truncated, providing a corrupt image and therefore failing conversion. I just wanted to check before I spend too long investigating this, if there is a string size limit for use with HTTP.PostString.
The String I am trying to send is about 40kb including a Base64 encoded image.
The XML string is built like this:
B4X:
XML="<?xml version=""E&"1.0""E&" encoding=""E&"utf-8""E&" ?>"&CRLF
XML=XML&"<queue>"&CRLF
XML=XML&" <apiKey>"&apiKey&"</apiKey>"&CRLF 'Private API Key
XML=XML&" <targetType>image</targetType>"&CRLF
XML=XML&" <targetMethod>convert-to-jpg</targetMethod>"&CRLF
XML=XML&" <testMode>true</testMode>"&CRLF
#Region Send URL
'either send source URL
'XML=XML&" <sourceUrl>http://www.stevelaming.co.uk/stevel05/images/icon72.png</sourceUrl>"&CRLF
#End Region
'#Region Embed File
'Or embed a file ______________________________________________________
Dim fileName,imageString As String
Dim Image As Bitmap
Dim out As OutputStream
Dim fileData() As Byte
Dim su As StringUtils
fileName="testfile.png"
imageString=" test encoded file goes here"
XML=XML&" <file>"&CRLF
XML=XML&" <fileName>"&fileName&"</fileName>"&CRLF
XML=XML&" <fileData>"&CRLF
XML=XML&" "&imageString&CRLF 'Image As string
XML=XML&" </fileData>"&CRLF
XML=XML&" </file>"&CRLF
' _____________________________________________________________________
'#End Region
XML=XML&"</queue>"
'Log("Xml "&XML)
EditText1.text=XML
URL="http://api.online-convert.com/queue-insert"
HttpUtils.PostString("queue",URL,"queue="&XML)