Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2796

oData image upload

$
0
0

Hi experts.......

 

 

I am new for this sapui5 .......

Actually i am doing one image uploading by using odata .  I converted the image and keeping ready but how to post that image to back end i dont know if u guys know this plz help me............

 

This is my coding..

 

 

     var oModel = this.oView.getModel();

  

   var button = this.getView().byId("upload");
  
     var upload = this.getView().byId("fileUploader");
  
       var oDialog = new sap.m.Dialog ({contentWidth:"70px"});
   // oDialog.open();

        var file = jQuery.sap.domById(upload.getId() + "-fu").files[0];

 

 

  if(file===undefined)return;

  
     var BASE64_MARKER = 'data:' + file.type + ';base64,';

 

 

        var filename = file.name;

        var reader = new FileReader();

  // On load set file contents to text view

        reader.onload = (function(theFile) {

        return function(evt) {

        oModel.oData.personal[0].base64 = evt.target.result.indexOf(BASE64_MARKER) + BASE64_MARKER.length;

        oModel.oData.personal[0].base64Index = evt.target.result.substring(oModel.oData.personal[0].base64Index);

 

 

Thank you

 

 

 

 

Regards..

 

Damian.a


Viewing all articles
Browse latest Browse all 2796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>