Hi all.
I want file upaload in sharepoint's document use my Webpart.
this is my source
protected void Button1_Click(object sender, EventArgs e)
{
using (SPSite site = new SPSite("http://nar-cla500s3:12345/sites/qa"))
{
using (SPWeb web = site.AllWebs[""])
{
string filepath = @"C:\Users\lx13040020\Desktop\test.xlsx";
FileStream filestream = File.OpenRead(filepath); <-- error access denied
SPFile file = web.Folders["QADocument"].Files.Add(filepath, filestream, true);
}
}
But I have error "access denied".
I referd to this link
(SPFile ex)
(Filestream Access denied)
http://stackoverflow.com/questions/7706467/access-to-the-path-denied-error-in-c-sharp
But i could not solve my problem.
please teach me, Wait for your help. Thank you