AnsweredAssumed Answered

Binary Data Storage - Seeking working example

Question asked by Robert Hanson on Jul 28, 2014
Latest reply on Oct 16, 2017 by Nils Drews

Does anyone have a working example of using the Binary Data Storage API?  I am getting 500 errors when I am posting the binary data to Jive using the temporary URL.  I'm attempting this from a Jive app.

 

ref: Binary Data Storage Usage

 

This is the code I'm running in the Jive app.  Unless I'm misunderstanding how to use the mechanism it is fetching the token, and then trying to POST data to the URL.  This is however resulting in a 500 error when posting the content.

 

osapi.jive.binary.token({
    duration : 10,
    name : 'readme.txt',
    verb : 'POST'
}).execute(function(response) {

    var fd = new FormData();
    var blob = new Blob(["Hello World"], {type : 'text/plain'});
    fd.append('file', blob, "readme.txt");
  
    $.ajax({
      url: response.url,
      data: fd,
      processData: false,
      contentType: false,
      type: 'POST',
      success: function(data){
        alert(data);
      }
    });
});

 

Any ideas would be appreciated.

Outcomes