1

我的环境中有 wcf 服务器和 web 服务器。

SharePoint 托管在 Web 服务器中。

当我使用此方法从 Web 服务器添加文件时,就可以了。

然后设计更改来了,我从 wcf 服务器添加了文件,我遇到了错误。

SPFolder.Files.Add(fileName, memoryStream, true); // Errors here

堆栈跟踪:

URL 'Template/Template.docx' 无效。它可能引用不存在的文件或文件夹,或者引用不在当前 Web 中的有效文件或文件夹。---> System.Runtime.InteropServices.COMException (0x81020030): 0x81020030 URL 'Template/Template.docx' 无效。它可能引用不存在的文件或文件夹,或者引用不在当前 Web 中的有效文件或文件夹。在 Microsoft.SharePoint.Library.SPRequestInternalClass.PutFile(字符串 bstrUrl,字符串 bstrWebRelativeUrl,对象 punkFile,Int32 cbFile,对象 punkFFM,PutFileOpt PutFileOpt,字符串 bstrCreatedBy,字符串 bstrModifiedBy,Int32 iCreatedByID,Int32 iModifiedByID,对象 varTimeCreated,对象 varTimeLastModified,对象 varProperties, String bstrCheckinComment, Byte partitionToCheck, Int64 fragmentIdToCheck,

当我的代码在 Web 服务器中时,它运行良好。请帮我。

4

0 回答 0