My application edits a file in SharePoint through Web Client / WebDAV (WebDAV redirector). How can I check / register?

I am integrating my application so that it can edit files stored in SharePoint. I use the AKA WebDAV Redirector web client service (webclnt.dll), which does an excellent job so that regular CreateFile / read / write Windows api calls are redirected from the normal I / O path to the network via the WebDAV network. However, I can read-only access the file if it is registered.

Using the web client service, how can I get the file to be extracted when I edit it and then get it to check when I finish editing it?

Edit: I tried using GetFileAttributes and SetFileAttributes to check FILE_ATTRIBUTE_READONLY, hoping that I can use this flag to determine when the file was not extracted and then check it (resetting this flag to check, then setting it to check it) . Bad luck; the file is always displayed as not only read-only.

+4
source share
1 answer

To perform file registration / verification, you need to use the following code:

SPSite oSite = new SPSite ("http://<sitename>/"); SPWeb oWeb = oSite.OpenWeb(); SPList oList = oWeb.Lists["Shared Documents"]; SPListItem oListItem = oList.Items[0]; //taking the first list item oListItem.File.CheckOut(); oListItem["Name"] = "xyz"; oListItem.Update(); oListItem.File.CheckIn("file name has been changed"); 

If you need to complete registration / verification through SharePoint WebService, then you should take a look at the Brad McCable blog code on a Windows Example Sharepoint Services Web Service .

+1
source

All Articles