Odoo Controller base64 image encode to base64 decode - postgresql

currently i have to build Odoo API to get image base64 code via postman and store into odoo database as image.
I want to ask how to decode base64 encoded image into odoo controller and store image into database?

Related

Upload image binary objective c

I have one request where I want to upload image in binary as attached screenshot of postman.
Also the image request doesn't require key so sending a multipart / form data doesn't work here which I have already tried.
In android I am sending the same request as
httpPost.setEntity(new ByteArrayEntity(ImageData))
enter image description here

How to get image url from server response in swift 4 using Alamofire framework

I beginner in iOS, how to parse an image url from server response and display image in image view. Before to display an image i used a variable of type String to store server url and convert to string url to of type NSURL, But now bunch of images coming from JSON response.
In above image which contain only one element, like this a 20 to 30 elements are coming from server. I want access that profile element and photo (Key).
In the above image just neglect that search loop code.
In the above image I am Mapping to cell of tableview.
Can anyone suggest me how to parse this JSON response using Alamofire Framework and i used a Alamofire Image Framework also to parse an image.
Thanks in Advance
After converting it to NSUrl, You need to download that image from server , for that you can use NSData or other libraries like https://github.com/SDWebImage/SDWebImage or https://github.com/onevcat/Kingfisher.

Multipart upload binary content with OneDrive Rest APIs

As per the API documentation here I formed my request with postman as follows:
. This is working fine.
But when it comes to binary content(encoded in base64 format), it uploads the file but that is not previewed when I try to open the same on OneDrive.
File gets uploaded successfully but not previewable.
What am I missing here? Any suggestions?
OneDrive doesn't support Content-Transfer-Encoding when using the multi-part upload method. In this case, we're ignoring the header (that seems like a bug) and just storing the base64 encoded data in the file stream (without decoding it).
You'll have to upload the raw bytes as the second part of the request, without any content-transfer-encoding, to have this work.
Since it seems like you are just uploading a file and not trying to set any custom metadata while doing it, you're better off using one of the other upload methods, like PUT or createUploadSession
Drive does not store the image in the base64 format it stores it in binary. you can directly select the image using postman and can upload as binary with the multipart request
Here is the link for adding blob in the postman
How to upload images using postman to azure blob storage

Can I replace multiform uploads by using base64 in HTTP uploads?

Hey so this might be a broad question, but I'm currently designing a REST api and I've currently been using multipart-form to upload files. The thing is that I would like to upload a file in a Patch request, which doesn't allow multipart data, but does allow the data to be uploaded in the body of the request. I would like to have one way to upload files to be standard in my API. Should I stick with multipart or would it be okay to just attach a base64 string with a mimetype in the body of my request? Would there be any limitations to the base64 method? I'm mostly planning to upload pictures no more than 3MB if that makes a difference.

Rest Service To Send An Image

We have stored images of users in a database, and we have exposed the rest services to read the images. Now how it works is that if I invoke the rest service in a browser, the browser directly displays the image in the browser. I directly send the image as a rest response. Now we want to send some other attributes like does the user has image associated and so on. So we decided to create a bean with attributes like that, and an byte array. The byte array contains the binary content of the image. Is it possible to achieve as mentioned, can we reconstruct the image in the client side with the binary array.
Yes, definitely it is possible to send images through Rest service and client of calling service can use that image. What you have to do is, convert your binary data to Base64 encoded string and set the proper content type and then return this response from your Rest service.