code: function (filePath) {
      casper.wait(1, function () {
          this.echo('#green{upload:} #yellow{[' + filePath + ']}');
          this.fill('form[name=form1]', {
              "upfile": filePath,
              "addmat": '1',
              'overwrite': params.overwrite ? '0' : '1'
          }, true);
      });
  
      casper.wait(waitTime, function () {
          var info = casper.evaluate(function () {
              return document.getElementById('top_tips').innerText;
          });
          this.echo(info);
      });
  }
docs: 上传一个文件到指定目录
  @param filePath