Checkin and checkout a VPP file

Vote:
 

Hi,

I want to get a file from the VPP using c# and when I do I want to Check it out, when the user has updated the file I want to check it back in. Can this be done via c#?

Thanks

Jon

#113099
Nov 13, 2014 9:16
Vote:
 

You can get the file, check it out and then check it in as:

VersioningFile file = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(path) as VersioningFile;
file.CheckOut();
//Update file
file.CheckIn("updated");
#113148
Edited, Nov 14, 2014 8:38
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.