Can I send image file from FileRepository using Thinworx service to the external php server?
Try using Resources["ContentLoaderFunctions"].PostImage(params), but it throw exception
"Unable To Convert From [B to JSON"
could you please try converting the imageFile to base64 and then try sending it in params.
var Content = Things["NearmissImages"].LoadImage({ path: '/bag.jpg' })
var encodedValue = base64EncodeString(Content);
var params = {
headers: {"ContentType" : "multipart/form-data"},
ignoreSSLErrors: true,
mimeType: 'image/jpeg',
url: 'http://143.39.248.12/esystem/php/test.php',
content: encodedValue,
timeout: 10000
};
var result = Resources["ContentLoaderFunctions"].PostImage(params);
Could you try loading the image first then convert it to base64 and do a simple rest request to your page with base64 string as body.
Which snippet do I need to use to convert an image to Base64?
I try to use base64DecodeBytes and base64DecodeString, but they throw exception "Invalid length".
