title: Using UploadCollection to upload files with ajax in sapui5 send broken files?
body: <p>Iam trying to use the UploadCollection with ajax in order to send files through a post request, but for some reason, the file get's uploaded but it can never be open o visualize since the file seems to arrive broken in the backend (sap gateway) side.</p>
  
  <p>This is the way I'm getting the file using the UploadCollection</p>
  
  <pre><code>                new sap.m.UploadCollection({
                      id:                        'upFiles',
                      numberOfAttachmentsText:   'Adjuntar archivos',
                      showSeparators:            'All',
                      fileType:                  ['jpg','jpeg','png','pdf','ods','pptx','xlsm','docx','doc', 'odt', 'docm','ppt','xlsx','rar','zip'], 
                      noDataText:                'No se han cargado archivos todavia',
                      class:                     'docpago-upload',
                      uploadUrl:                 '/sap/opu/odata/SAP/ZGWRE_WF_FILES_SRV/WfFileCollectionSet',
                      maximumFilenameLength:     120,
                      maximumFileSize:           10,
                      multiple:                  true,
                      uploadEnabled:             true,
                      terminationEnabled:        true,
                      change: function(oEvent) {
  
                          var file = oEvent.getParameter("files");
                          var numfiles = oEvent.getParameter("files").length;
  
                          if(numfiles &gt; 10){
                              MessageBox.show("Máximo de cargas multiples permitido es de 10");
                              oEvent.setCancelBubble(true);
                              oEvent.cancelBubble(); // para detener el proceso...
                          }else{
  
                              subeArchivos = true; 
  
                              $.each(file, function(i, val) {
  
                                  console.log(val);
  
                                  fixname = val.name;
                                  filename = fixname.substring(0, fixname.indexOf("."));
                                  extension = fixname.substring(fixname.indexOf(".") + 1);
  
                                  //console.log('nombre archivo: ' + filename)
                                  //console.log('extension archivo: ' + extension)
  
                                  var obj = {
                                      'filename': filename,
                                      'extension': extension
                                  };
  
                                  files.push(obj);
  
                              });
  
                          }                           
                      }
                  });
  </code></pre>
  
  <p>And this is the way Iam trying to send these files using ajax</p>
  
  <pre><code>                                                    jQuery.ajax({
                                                          url: sUrlUpload,
                                                          type: "POST",
                                                          data: file, //Files I want to upload
                                                          contentType: "application/json",
                                                          datatype : "text",
                                                          headers: {
                                                              'X-CSRF-Token': token, //token generated to send request
                                                              'slug': slug  //a parameter I need to do some stuff
                                                          },
                                                          success: function (data, textStatus, XMLHttpRequest) {
                                                              console.log('Uploaded files: ' + JSON.stringify(data));
  
  
                                                          },
                                                          error: function(oError) {
                                                              console.log('Error: ' + JSON.stringify(oError.responseText))
                                                          }
                                                      });
  </code></pre>
  
  <p>For some reason, In the sap gateway side, files are successfully uploaded but not even single one can be open because the programs say "invalid format", "corrupted file" etc etc.</p>
  
  <p>What I'm not sure about? I was ask to send the files through ajax one by one, and in a xstring format. but I'm not sure how to get that xstring of every single file</p>