in SharePoint 2010, I created a DLL that I deploy to the GAC. From this assembly, I try to save a file then access the file I just saved in a temporary location, such as C:\temp. Everytime I try to do so, I get:
Access to the path 'C:\temp' is denied.
So I go to this folder on the server, and add Everyone to the security settings and give Everyone Full Control as a test; same result.
Any ideas what could be causing this? My DLL is correctly referenced in the Web.Config:
<SafeControl Assembly="My_SharePoint_Namespace", Version=1.0.0.0, Culture=neutral, PublicKeyToken="abcdefghijklmnop" Namespace="My_SharePoint_Namespace" TypeName="*" Safe="True" SafeAgainstScript="True" />
Any ideas why I would be getting this error?
using (FileStream stream = new FileStream(file_info.Directory.FullName, FileMode.Create, FileAccess.ReadWrite))
{
stream.Write(fileBytes, 0, fileBytes.Length);
}