Is it possible to create a custom REST end point to save an uploaded image to a folder and then add or update a row in a table in a single API call?
Hello @Francis_Thong
Yes, it is possible
you can create an API Service and pass there your image converted to base64 string and then save it to the Files and create/update a Data object
here are a few helpful links
- https://backendless.com/docs/bl-js/bl_basic_quick_start_guide_js.html
- https://backendless.com/docs/js/file_save_files_from_byte_arrays.html
- https://backendless.com/docs/js/data_single_object_update.html
- https://stackoverflow.com/a/14573049
Regards, Vlad
Hi,
I’ve tried to create the custom server side api code to receive a post request with the image in formData.
But I’m always getting an error.
Upon further testing, I found that it is due to the Content-Type not in json format.
I’m not sure how I can post the image with other parameter and not using the multipart/form-data.
Are u able to provide some advice ?
convert image into base64