Tuesday, June 1, 2010

Upload a file to Sharepoint 2007 using Web Services

CopySoap client = SoapClientFactory.GetCopySoap_Sync();
CopyIntoItemsRequest req = new CopyIntoItemsRequest();
req.SourceUrl = GlobalVars.GetDestinationUrl(file.Name);//not important??
req.Fields = new FieldInformation[]{
new FieldInformation() {
DisplayName = "Title",
InternalName = "Title",
Value = file.Title,
Type = FieldType.Text
}
};
req.DestinationUrls = new string[]{ GlobalVars.GetDestinationUrl(file.Name) };
req.Stream = file.Data;

No comments:

Post a Comment