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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -