Aras学习笔记 (43) 上传文件方法
1 public FILE UploadFile(string FileName, string FilePath) 2 { 3 FILE file = new FILE(); 4 5 try 6 { 7 Item item = innovator.newItem("File", "add"); 8 item.setProperty("filename", FileName); 9 item.attachPhysicalFile(FilePath); //物理路径 10 item = item.apply(); 11 12 if (!item.isError()) 13 { 14 ModelHelper helper = new ModelHelper(); 15 file = helper.GetModelByItem<FILE>(item); 16 } 17 } 18 catch (Exception ex) 19 { 20 21 } 22 23 return file; 24 }