on 01-04-2024 10:39 AM
Hi Expert
I am excuting ajax query to get base64 image from non sap server. I am getting image in base base64 format like "iVBORw0KGgoAAAANSUhEUgAABDgAAAQ4CAMAAADbzpy9A".
And trying attach image to <Image> tag in xml. like
e.photo having base 64 ="iVBORw0KGgoAAAANSUhEUgAABDgAAAQ4CAMAAADbzpy9A".
const base64 = "data:image/jpeg;base64,"+e.photo;
const [type,data] = base64.split(",");
const blob = new Blob([data],{type});
const url = URL.createObjectURL(blob);
that.byId("userExtPhoto").setSrc(url);
But image not reflecting.. any suggestion.
I gone through all sap blogs.
Last option send base64 to createstream and get /$value from sap.
Thanks
Radhesh
Hi Rahul
Please check this.
xml
<Image height="280px" id="userExtPhoto" visible="true" width="10em" densityAware="false" />
var testpic = "iVBORw0KGgoAAAANSUhEUgAAAEgAAAAoCAIAAADSeytKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADlSURBVGhD7ZS9DYMwEEZd0VBRUFDQMwBDMAQ1e3gPSlbICKzCHPEF/2EkhIiE8pHv9Ir4zpZ4usup11I/EoqhQTE0KIYGxdCgGBoUQ+Os2Kgz1ZdJ8gyXH37Jf4sNrfLR6OqTrKJkrt1N0bCRDXN8xz+8iYsd073yRym1xWh+z0UTSYYqzCiKgGmIr5bdepS86iafF+DEknCeruQHD04sHbktpoe2dQhi6x9JkK1wuAzkQhALD+/jrNhuxjYbz376lNujid3c/uhWhINiaFAMDYqhQTE0KIYGxdCgGBoUQ+OhYkv9Bnoy5jrS5HcwAAAAAElFTkSuQmCC";
var url = "data:image/bmp;base64," + testpic.substr(104);
that.byId("userExtPhoto").setSrc(url);
not working, any suggestion
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.