上传时未设置文档标题

Document title not set on upload

我正在使用复制 Web 服务将文件上传到 SharePoint 列表。我还使用以下代码更新上传文件的标题字段。

 FieldInformation obj = new FieldInformation();
        obj.DisplayName = "Title";
        obj.InternalName = "Title";
        obj.Type = FieldType.Text;
        obj.Value = "Test Title 1";

Web 服务正在上传文件,但未更新标题字段。标题字段与实际文件名保持一致,不会更新为 'Test title 1'.

我找到了解决方法,我少了一行。

copyservice.FieldInformation[] info = { obj };