我正尝试使用SharePoint的CopyService上传文件。它工作正常,直到我意识到当文件名以'。'结尾时。 (点)例如测试。 .docx,test ... docx,test .... docx等。我将CopyResult作为无效的URL。使用CopyService上传文件错误SharePoint
我不是100%确定如果这些名称是有效的,应该像简单的文件名称上传,或者我应该显示错误消息说我的用户无效的文件名。
请帮忙。
我的代码 -
public static void CopyImageOnServer(string sourceUrl, string destinationUrl, byte[] fileData)
{
PBSWebApplication.CopyServiceReference.CopySoapClient proxy = Utility.GetServerCopyProxy();
// List of desination Urls, Just one in this example.
string[] destinationUrls = { Uri.EscapeUriString(destinationUrl) };
// Empty Field Information. This can be populated but not for this example. SharePoint2007CopyService.FieldInformation information = new SharePoint2007CopyService.FieldInformation(); SharePoint2007CopyService.FieldInformation[] info = { information }; // To receive the result Xml. SharePoint2007CopyService.CopyResult[] result;
// Empty Field Information. This can be populated but not for this example.
CopyServiceReference.FieldInformation information = new CopyServiceReference.FieldInformation();
CopyServiceReference.FieldInformation[] info = { information };
// To receive the result Xml.
CopyServiceReference.CopyResult[] result;
uint returnValue = proxy.CopyIntoItems(sourceUrl, destinationUrls, info, fileData, out result);
if (result[0].ErrorCode != CopyServiceReference.CopyErrorCode.Success)
{
// ...
}
}
感谢。