예제 #1
0
 public Guid AsyncUpload(FileUploadInfo[] file)
 {
     if (file.Length > 0)
     {
         return _fileStore.SaveUploadedFile(file[0].File);
     }
     else
     {
         return Guid.Empty;
     }
 }
예제 #2
0
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            var files = controllerContext.HttpContext.Request.Files;
            var list = new List<FileUploadInfo>();

            for (int i = 0; i < files.Count; i++)
            {
                var file = files[i];
                var name = files.AllKeys[i];
                var fileInfo = new FileUploadInfo(name, file);
                list.Add(fileInfo);
            }

            return list.ToArray();
        }