I followed [this] to convert a SharePoint List Item to word (and then word to PDF). I am using a dotx template file from a Document Library to create a word file and save it in the same doc library. When I deployed this custom solution on test server it worked fine(worked fine on Dev too), but when I move the same solution to Production, I get "Error :Access to the path '\SERVERNAME\sites\SITENAME\DOCLIBNAME\Forms\StaffTemp.dotx' is denied."
Here is how I am copying the file.... string templateFile = "\\SERVERNAME\sites\SITENAME\DOCLIBNAME\Forms\StaffTemp.dotx";
string destinationFile = "\\SERVERNAME\sites\SITENAME\DOCLIBNAME\" + filename + ".docx";
File.Copy(templateFile, destinationFile, true); File.SetAttributes(destinationFile, FileAttributes.Normal);
Can anyone tell me what I can do to solve this? Thank you.