title: openui5 FileUploader not working
body: <p>I am trying to upload a file with a simple form. I can choose a file but when I click on "upload" nothing happens.</p>
  
  <p>My FileUploader.view.xml is like:</p>
  
  <pre><code>&lt;mvc:View
  controllerName="sap.ui.unified.sample.FileUploaderBasic.Controller"
  xmlns:l="sap.ui.layout"
  xmlns:u="sap.ui.unified"
  xmlns:mvc="sap.ui.core.mvc"
  xmlns="sap.m"
  class="viewPadding"&gt;
  &lt;l:VerticalLayout&gt;
      &lt;u:FileUploader
          id="fileUploader"
          name="myFileUpload"
          uploadUrl="upload/"
          width="400px"
          tooltip="Upload your file to the local server"
          uploadComplete="handleUploadComplete"/&gt;
      &lt;Button
          text="Upload File"
          press="handleUploadPress"/&gt;
  &lt;/l:VerticalLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>My Contoller.controller.js</p>
  
  <pre><code>sap.ui.define(['sap/m/MessageToast','sap/ui/core/mvc/Controller'],
  function(MessageToast, Controller) {
  "use strict";
  
  var ControllerController = Controller.extend("sap.ui.unified.sample.FileUploaderBasic.Controller", {
      handleUploadComplete: function(oEvent) {
          var sResponse = oEvent.getParameter("response");
          if (sResponse) {
              var sMsg = "";
              var m = /^\[(\d\d\d)\]:(.*)$/.exec(sResponse);
              if (m[1] == "200") {
                  sMsg = "Return Code: " + m[1] + "\n" + m[2] + "(Upload Success)";
                  oEvent.getSource().setValue("");
              } else {
                  sMsg = "Return Code: " + m[1] + "\n" + m[2] + "(Upload Error)";
              }
  
              MessageToast.show(sMsg);
          }
      },
  
      handleUploadPress: function(oEvent) {
          var oFileUploader = this.getView().byId("fileUploader");
          oFileUploader.upload();
      }
  });
  
  return ControllerController;
  
  });
  </code></pre>
  
  <p>When I run this in the debugger I get an Uncaught TypeError:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property '1' of null
  at f.handleUploadComplete (FileUploader.controller.js?eval:11)
  at f.a.fireEvent (EventProvider-dbg.js:229)
  at f.a.fireEvent (Element-dbg.js:427)
  at f.fireUploadComplete (ManagedObjectMetadata-dbg.js:426)
  at HTMLIFrameElement.eval (FileUploader.js?eval:6)
  at HTMLIFrameElement.dispatch (jquery-dbg.js:4737)
  at HTMLIFrameElement.c3.handle (jquery-dbg.js:4549)
  
   if (m[1] == "200") {
                  sMsg = "Return Code: " + m[1] + "\n" + m[2] + "(Upload Success)";
                  oEvent.getSource().setValue("");
  </code></pre>
  
  <p>I searched for sample code and it seems my code is ok, but I don't know why I can't upload a file by click on the button.</p>