I'm trying to update SPFile
properties.
Here is my code:
using (SPSite oSite = new SPSite(sFileURL))
{
using (SPWeb oWeb = oSite.OpenWeb())
{
oWeb.AllowUnsafeUpdates = true;
oFile = oWeb.GetFile(sFileURL);
foreach (XmlNode xNode in oXmlDoc.FirstChild.ChildNodes)
{
oFile.Item.Properties[xNode.Name] = xNode.InnerText;
string itemmm =oFile.Item.Properties[xNode.Name].ToString();
}
oFile.Update();
oWeb.AllowUnsafeUpdates = false;
}
}
The problem is that when I check the file properties in SharePoint I don't see the changes I have made.
I was trying to add AllowUnsafeUpdates = true
but it didn't solve the problem.
What else can I do?