I'm new to sharepoint, I have a requirement where i have to attach a file to the List. I have tried to attach the file to the List using C#. But i'm getting Access denined as error message.
I have written the following code to attach the file to the List. But i dont know how to give write permission to the Users
I have enabled the anonymous access for the site in Central admin.
Is there any other place where i have provide the permission or is it possible to provide permission to the User programmatically?
Please help me how to solve this or suggest me some URL or send me some sample code which would help me in solve this problem.
Thanks in advance
SPWeb web = SPContext.Current.Web;
web.AllowUnsafeUpdates = true;
SPList list = SPContext.Current.Web.Lists["spforums_posts"];
SPListItem listItem = list.Items;
string FileNameSave = MsgeInId + "_" + _btnUpload.FileName.ToString();
web.AllowUnsafeUpdates = false;
Page.Response.Write("<center>" + Ex.Message.ToString() + "</Center>");