code: function isAlreadyUploaded(file_mngr_url, filename, file_exists_cb, file_absent_cb) {
      var req = new XMLHttpRequest();
      req.open("GET", file_mngr_url + "/test/" + filename);
      req.onload = function(e) {
          var url = JSON.parse(req.response).url;
          if (url === undefined)
              file_absent_cb();
          else
              file_exists_cb(url);
      };
      req.send();
  }
docs: Helper function This function checks if a particular filename already exists. If so it executes the first callback that is passed, otherwise the second one