在平台上可以使用代码来上传附件
首先在你的文件服务器根据你的业务数据去掉记录所对应的附件,然后使用代码来上传附件。参考:代码如下
引用【业务模型\协同系统\文档\文档库】
procedure TFRMDOCCENTER.UpLoadClick(Sender: TObject);
var
lFileName, osFile, lExt: string;
lFileAttribute: TFileAttribute;
begin
if (edit1.Text = '') or (edit2.Text = '') or (edit3.Text = '') then
begin
jsDialogs.ShowMsg('请选择上文件和存储路径!', '提示:');
exit;
end;
lFileAttribute := TFileAttribute.Create;
try
lFileAttribute.DisplayName := edit1.Text;
lFileAttribute.Size := 0;
lFileAttribute.CreateTime := SysUtils.Now;
lFileAttribute.IsDirectory := false;
lFileAttribute.IsHidden := false;
lFileAttribute.IsSpace := false;
lFileAttribute.LastWriteTime := SysUtils.Now;
lFileAttribute.ValuesAsString['OSFILENAME'] := edit3.Text;
lExt := Sysutils.ExtractFileExt(edit1.Text);
lFileName := edit2.text + jsCommon.CreateGUIDStr + lExt;
osFile := TUnStructureDocUtils.NewFile(Context, lFileName, lFileAttribute);
//TDocSystem.CheckIn(Context, lFileName);
finally
lFileAttribute.Free;
jsDialogs.ShowMsg(osFile, 'UpLoad:');
end;
end; |