For testing, I built the same codeless code on the front end and the back end to upload an image. The frontend call works, but when I pass the same byte array (Uint8Array) from the front end to the back end, it seems to get stringified or something and doesn’t work.
The question is, how would I pass a byte array from the front end to the back end without it being “changed” or whatever is happening that the data isn’t the same when it arrives at the backend.
I take the fieData string, and convert it to an object. Then, in the custom code, I convert the object to an array and then convert the array to a Uint8Array.
Unfortunately, the approach will not work without additional workarounds that can affect performance. Because an API service running in Backendless can accept requests only with the application/json Content-Type for POST and PUT requests.
If you need to send a file, you’d need to encode the file contents in the request body. Please use base64 encoding for this purpose.