Esempio n. 1
0
 /// <summary>
 /// 配置接受的文件类型
 /// </summary>
 private void ConfigAccept(UploadBuilder builder)
 {
     if (_config.Contains(UiConst.Accept))
     {
         builder.Accept(_config.GetValue(UiConst.Accept));
         return;
     }
     builder.Accept(GetAccepts());
 }
Esempio n. 2
0
        /// <summary>
        /// 配置文件类型限制
        /// </summary>
        private void ConfigFileTypes(UploadBuilder builder)
        {
            if (_config.Contains(UiConst.FileTypes) == false)
            {
                return;
            }
            var types = _config.GetValue <List <FileType> >(UiConst.FileTypes);

            if (types == null)
            {
                return;
            }
            builder.Accept(types.Select(t => t.GetNames()).Join());
            builder.FileType(types.Select(t => t.Description()).Join());
        }
Esempio n. 3
0
 /// <summary>
 /// 配置文件类型限制
 /// </summary>
 private void ConfigFileType(UploadBuilder builder)
 {
     builder.Accept(_config.GetValue(UiConst.Accept));
     builder.FileType(_config.GetValue(UiConst.FileType));
     ConfigFileTypes(builder);
 }