public class UploadHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
...
// Create the directory if needed...
if (!Directory.Exists(uploadDir))
{
System.Security.AccessControl.DirectorySecurity ds = new System.Security.AccessControl.DirectorySecurity(RivWorks.AppSettings.UploadRoot, System.Security.AccessControl.AccessControlSections.All);
Directory.CreateDirectory(uploadDir, ds);
}
...
}
I have the above snippet of code for a ASHX file and it works fine in my local environment. As soon as I push it to a server environment I don't get an error, it appears to have built the directory, yet when I check for it - well - it is not there. When I run it via a FLEX app we are getting this error:
Error #2038: File I/O Error. URL: http://%5Bourdomain%5D.com/UploadHandler.ashx?CompanyID=d229cc80-ca96-4a8a-992c-80c94ac2c6b4
Is there anything I am missing?
UPDATE:
- I can create files anywhere on disk
- I cannot create directories anywhere on disk.
I get this error now when trying to create a directory:
The process does not possess the 'SeSecurityPrivilege' privilege which is required for this operation.