248
Views
6
Comments
Solved
Uploading Image as binary data through API in Database
Question

Hi All,

I want to send the Image store in my System to My Outsystems entity through an API Post method what will be the best Method for the same .

in Picture i have to provide Binary Data how can i do it??

Or there is another way to do the same??

Thanks,

Jitendra

2021-08-04 12-19-54
Mayank Dharmpurikar
Solution

Hi Jitendra,

Call your API like below image, For the Image column, you need to send the Base 64 image format, use any of the online tools to convert the image into base 64 format, and pick that base 64 formats (by removing this from that "data:image/jpeg;base64, ") and assign it to the image column.  

2019-07-01 07-16-04
Vinod Patidar

Hi Jitendra,

Please check below Forge Component -

https://www.outsystems.com/forge/component-overview/4026/multipart-form-data

Please install the demo application and check -


Thanks

Vinod


UserImage.jpg
vikas sharma
Champion

For this your api should also support multipart request.

2021-08-04 12-19-54
Mayank Dharmpurikar

Hi Jitendra,

If I understand your use-case correctly, you have images in your systems (local machine), and you want to save those images(Picture) with other information (Name, Age, Email, Phone, Address) in your entity. You already created the API to accept the Entity type; now you're using Postman to call your API and save this information into Entity.

Now you are looking for how to call this API with data from Postman?

Is this your use case, or did I get it wrong?


2022-07-28 08-07-39
Jitendra Kumar

@Mayank Dharmpurikar 

yes you got it 100% correct.

2021-08-04 12-19-54
Mayank Dharmpurikar
Solution

Hi Jitendra,

Call your API like below image, For the Image column, you need to send the Base 64 image format, use any of the online tools to convert the image into base 64 format, and pick that base 64 formats (by removing this from that "data:image/jpeg;base64, ") and assign it to the image column.  

2021-08-04 12-19-54
Mayank Dharmpurikar

Please let me know, Jitendra, if the above solution for your use-case was helpful or if you encountered any difficulties calling the API. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.