I need to add a new document link to a document library using the client object model. I suspect I could copy the format of the .aspx file used in the "link to a document" items and upload it as a normal file but I'm hoping there is a neater way.
So what I want to do is the same as the code sample below but instead of creating a new document I want to create a new link to a document.
ClientContext context = new ClientContext("http://wdev2008:22880");
context.Load(context.Web);
List list = context.Web.Lists.GetByTitle("Test Doc Link Library");
context.Load(list);
context.ExecuteQuery();
FileCreationInformation fileCreateInfo = new FileCreationInformation();
fileCreateInfo.Content = new byte[] { 0x33 };
fileCreateInfo.Url = "zerobyte";
File file = list.RootFolder.Files.Add(fileCreateInfo);
context.Load(file);
context.ExecuteQuery();
Update: According to the mod on this forum I'm not allowed to ask how to do this with a web service in a separate question so I'll change the title, tags and content on this question. Does anyone know how to do the insert with a SharePoint web service or server side control or anything else?