记录:web上传文件调用代理读取数据
xsp页面调用代理
var xdoc = currentDocument;
var formAgent = "agent"
var cdoc = xdoc.getDocument(true);
var agent:NotesAgent = database.getAgent(formAgent);
agent.runWithDocumentContext(cdoc);
LotusScript代理中获得web doc处理如下
'获得web文档
Set agentdoc = s.DocumentContext
sDir = s.Getenvironmentstring("Directory", True)
correctPath = replace(sDir,"\","/")
correctPath = correctPath + "/domino/html/temp/"
'获得上传的附件
ForAll i In agentdoc.Items
If i.type = Attachment Then
Set emb = agentdoc.GetAttachment(i.values(0))
End If
End ForAll
Set fso = CreateObject("Scripting.FileSystemObject")
'判断服务器上是否有该文件夹,没有则创建
If Not fso.FolderExists(correctPath)Then
fso.CreateFolder(Trim(correctPath))
End If
fileName = getRandomStr()+".csv"
correctPath = correctPath + fileName
'在服务器创建文件
emb.Extractfile(correctPath)
correctPath = Replace(correctPath,"/","\")