cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the image from the odata

former_member187227
Participant
0 Kudos

Hi Everyone,

     I'm working in SAP ui5 project here the odata contain image file as jpg format. I want to fetch the image and show it in the screen pls suggest some idea for it.

Content-Type:"image/jpeg";

Code:

get:function(){

var url = "proxy/http/71.170.170.211:8000/sap/opu/odata/sap/ZHR_APP_SRV/GetImagesSet('00800001.jpg')/$value";

  var username = "arunk";

  var password = "welcome01";

  var oModel = new sap.ui.model.odata.ODataModel(url,false,"arunk","welcome01");

  oModel.refreshSecurityToken();

  oModel.setHeaders({

  "X-Requested-With": "XMLHttpRequest",

          "Content-Type": "image/jpeg",

          "DataServiceVersion": "2.0",      

          "X-CSRF-Token":"Fetch"         

  });

  oModel.read('',null,null,true,function(oData, oResponse) { 

  

  });

  },

Accepted Solutions (0)

Answers (1)

Answers (1)

abin_babu2
Explorer
0 Kudos

Hi Vinoth,

This will help you.