Our new Community environment is going to be launched soon!
This means that you will be redirected to the new environment automatically, where you can sign-in, look up - and post topics again. Please note that not all topics will be transferred, so it might occur that you can’t find the topic you were looking for.
It is possible to upload an image through a HTTP PUT/POST JSON request. You just need to encode the image as an base64 encoded string and include it in JSON. For example:
Mind the '...', that is where the rest of the encoded string should be. Also pay attention to the format of the base64 encoded string. It should NOT be as following:You should strip everything before (and including) the comma. In the case above, strip the text 'data:image/jpeg;base64,' from the value you send to the server.Next, when uploading this text to BettyBlocks using a custom model or a separate input variable, use the 'base64_decode' expression to transform the image to an actual image file (as text). Example:Then you can just update the entity and assign this 'decoded_picture' text expression to the property of type 'Image' (or 'File'?).
It is possible to upload an image through a HTTP PUT/POST JSON request. You just need to encode the image as an base64 encoded string and include it in JSON. For example:
Mind the '...', that is where the rest of the encoded string should be. Also pay attention to the format of the base64 encoded string. It should NOT be as following:You should strip everything before (and including) the comma. In the case above, strip the text 'data:image/jpeg;base64,' from the value you send to the server.Next, when uploading this text to BettyBlocks using a custom model or a separate input variable, use the 'base64_decode' expression to transform the image to an actual image file (as text). Example:Then you can just update the entity and assign this 'decoded_picture' text expression to the property of type 'Image' (or 'File'?).
Login to reply