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

Popular posts from this blog

actionscript 3 - TweenLite does not work with object -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

c# - Global Variables vs. ASP.NET Session State -