sharepoint 2010 - Can't read file in ItemAdding event receiver -
i try read file in itemadding (sharepoint2010). use code:
public override void itemadding(spitemeventproperties properties) { xmldocument doc = new xmldocument(); string file = path.combine(properties.weburl, properties.afterurl); doc.load(file); }
but program return error in doc.load(file);
- remote server returned error: (401) unauthorized. how solve problem?
in user-context code running? have enough permissions file?
you try using elevated privileges http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
Comments
Post a Comment