title: is it possible to convert uploadcollection's object into a xstring?
body: <p>Using the sapui5 uploadcollection to upload files in the frontend and then sending them through ajax with a post request...</p>
  
  <p>I need to know how to convert te returned object from the uploadcollection control into a xstring, so then I can send that xstring (that contains the file content) To a sap gateway by using ajax post method.</p>
  
  <p>Any idea how could I do this?</p>
  
  <p>Right now I'm sending files by using the uploadcollection, once I upload an attachment, the control returns an object that represents the file content.</p>
  
  <p>I'm trying to make this object a xstring by using filereader:</p>
  
  <pre><code>                                                        //obtiene archivo
                                                          var file = files[i];
  
                                                          //Convierte archivo en binario
                                                          var reader = new FileReader();
                                                          reader.onload = function(readerEvt) {
  
                                                              var binaryString = readerEvt.target.result;
                                                              var base64 = btoa(binaryString);
                                                              var base64file; 
  
                                                              if(typeof base64file == "undefined" || typeof base64file == null){
                                                                  base64file = base64; 
                                                              }else{
                                                                base64file = base64file +'new'+base64;
                                                              }
                                                          };
                                                          reader.readAsBinaryString(file);
  
                                                          console.log(file)
  </code></pre>
  
  <p>But this work only with files of type image, the others like pdf, .doc etc etc give the following error when I try to send them with ajax. </p>
  
  <p>"The Data Services Request could not be understood due to malformed syntax". </p>
  
  <p>Any idea how can I send convert these files into a xstring data?</p>