html:
var jnmodalHTML = '<form action="/admin/admin/user/upload?sField=IMPORTUSERS" enctype="multipart/form-data" method="post" class="form-horizontal" name="jnmodalform" autocomplete="off" id="jnmodalform" novalidate="novalidate"><div class="modal-dialog " role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button><h4 class="modal-title">'+title+'</h4></div><div class="modal-body"><fieldset><div class="form-group"><label class="col-sm-3 control-label div-left-BILLPIC required" aria-required="true"> 上传文件: </label><div class="col-sm-8 bbb div-right-BILLPIC"><input type="file" id="file" name="UploadForm[file]"></div></div></fieldset></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">取消</button><button type="button" class="btn btn-primary" id="jnmodal-save">确定</button></div></div></div></form>'
content = '<input type="hidden" id="billid" name="billid" value="">';

JS:
$('.bbb').find('input[type=file]').ace_file_input({
    no_file:'没有选择文件',
         btn_choose:'选择',
         btn_change:'更改',
         icon_remove:null,
         droppable:false,
         thumbnail:false,//| true | large
         allowExt: ['xls','xlsx'],    //该属性只是对文件后缀的控制
         before_change: function(files, dropped){
            //选择文件 展示之前的事件
            //return true 保留当前文件; return false 不保留文件;return -1 重置文件框
            //需要同步等待返回结果
            return true;
         },
        }).on('file.error.ace', function(event, info) {
            alert("请上传excel格式文件");
      });
       


$('body').on('click','#jnmodal-save',function(){
        var url = '/admin/admin/user/upload';
           //类似ajax的提交
        //    $.post(url,$("#jnmodal-form").serialize(),function(res){
        //        console.log(res);
        //    },'json')
        console.log($("#file")[0].files);
        var form = $('#jnmodalform')[0];
        // Create an FormData object 
        var data = new FormData(form);
           $.ajax({
                url: url,
                type: 'POST',
                enctype: 'multipart/form-data',
                processData: false, 
                contentType: false,
                cache: false,
                data: data, 
                //dataType: "jsonP",
                success: function(jsonData) {console.log(jsonData);},
                error : function(XMLHttpRequest, textStatus, errorThrown) {
                            console.log('An Ajax error was thrown.');
                            console.log(XMLHttpRequest);
                            console.log(textStatus);
                            console.log(errorThrown);
                        }
            });








    })



控制器:
use jinxing\admin\models\forms\UploadForm;
use yii\web\UploadedFile;

public function actionUpload()
    {
        $model = new UploadForm();
        if (Yii::$app->request->isPost) {
            $model->file = UploadedFile::getInstance($model, 'file');
            $model->file->saveAs('/opt/html/bams/uploads/files/' . $model->file->baseName.'.'.$model->file->extension);
            // var_dump($model->file);
            // if ($model->file && $model->validate()) {                
            //     $model->file->saveAs('uploads/' . $model->file->baseName . '.' . $model->file->extension);
            // }
        }
exit;
        // return $this->render('upload', ['model' => $model]);
    }


模型:
use yii\web\UploadedFile;

public $file;

    public function rules()
    {
        return [           
            [['file'], 'file'],
        ];
    }

vendor\jinxing\yii2-admin\src\models\forms\UploadForm:

public $file;

public function scenarios()
 {
  return [
   'file' => ['file'],
  ];
 }
 // 验证规则
 public function rules()
 {
  return [
   [['file'], 'file', 'extensions' => ['xls','xlsx'], 'on' => 'file', "checkExtensionByMimeType" => false],
  ];
 }