Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Trouble inserting image/blob into Hana table

$
0
0

I am currently working on a Hana UI5 application to upload an image into a Hana table. I receive an error each time from the server for the BLOB column; however, have no issue inserting a character string.

 

    • My method to insert into the table. **

createRecord: function(success,failure,oEntry){

          var fileLoader = sap.ui.getCore().byId("uploadDemand"); 

          var fileName = fileLoader.getValue(); 

          

          var oEntry = {};

          oEntry.ONE = sap.ui.getCore().byId("PNText").getValue();

          oEntry.TWO= sap.ui.getCore().byId("PText").getValue();

          oEntry.THREE = sap.ui.getCore().byId("BText").getValue();

          oEntry.IMAGE1 = fileName; 

          alert(fileName);

          

          sap.ui.getCore().getModel("connect").setHeaders({"content-type" : "application/json;charset=utf-8"});

          sap.ui.getCore().getModel("connect").create('/Images', oEntry, null, function(response) {

               alert("Create successful");

                    if(success){

                         success(response);

                    };

               },

               function(response) { alert("Create failed");

                    if(failure){

                         failure(response);

                    }

               });

     }

 

-POST http://----


400 (Bad Request)

-The following problem occurred: HTTP request failed400,Bad Request,{ "error": { "code": "", "message": { "lang": "en-US", "value": "Syntax error at position 0."}}} - 


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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