pgrimes
Aug 1st, 2002, 03:05 PM
I am trying to use VB .NET and the "Scripting.FileSystemObject" to move around some files. I have done this plenty of times before in asp w/ vbscript. My problem seems to be a permissions issue according to the error message.
Here is the message I get:
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED).
Source Error:
Line 269: If Not objFSO.FileExists(uploadMovePath & "\" & moveFileName) Then
Line 270: objFSO.MoveFile(cptFilePath, uploadMovePath & moveFileName)
Line 271:
Source File: G:\WebServer\cpthandler\processUploads\WebForm1.aspx.vb Line: 270
Stack Trace:
[SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED).]
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
processUploads.processUpload.Page_Load(Object sender, EventArgs e) in G:\WebServer\cpthandler\processUploads\WebForm1.aspx.vb:270
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)
System.Web.CallHandlerExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I have given modify and delete permissions to IUSR_machine, IWAM_machine, ASPNET, and at one point even the EVERYONE account, but I keep getting the same security message. I have also changed the UserName to System (password=AutoGenerate) in the machine.config file. At one point, just to test it, I even set myself (an administrator account) as the default web guest account... I still got the security error. I am able to copy files without a problem, but I can't move or delete files. Is it possible this message could be generated due to a problem other than security? There is a possibility that I'm setting the perimssions wrong... I right click on the folder that the files are moved around in, click security tab, give appropriate users modify permissions, then I click advanced, then click view/edit, and check the delete box. I also make sure that it says apply to: "this folder, subfolders and files".
I have triple checked that the paths are corresponding to eachother correctly when I try to move the file. Here are the paths:
Move From:
G:\WebServer\cpthandler\SVGgraph\CPT Archive\temp\02-248.CPD
Move To:
G:\WebServer\cpthandler\SVGgraph\CPT Archive\2002 CPT Data\07-195901\02-248.CPD
If you want me to post my code, let me know.
Thanks for any help.
Paul
Here is the message I get:
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED).
Source Error:
Line 269: If Not objFSO.FileExists(uploadMovePath & "\" & moveFileName) Then
Line 270: objFSO.MoveFile(cptFilePath, uploadMovePath & moveFileName)
Line 271:
Source File: G:\WebServer\cpthandler\processUploads\WebForm1.aspx.vb Line: 270
Stack Trace:
[SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED).]
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
processUploads.processUpload.Page_Load(Object sender, EventArgs e) in G:\WebServer\cpthandler\processUploads\WebForm1.aspx.vb:270
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)
System.Web.CallHandlerExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I have given modify and delete permissions to IUSR_machine, IWAM_machine, ASPNET, and at one point even the EVERYONE account, but I keep getting the same security message. I have also changed the UserName to System (password=AutoGenerate) in the machine.config file. At one point, just to test it, I even set myself (an administrator account) as the default web guest account... I still got the security error. I am able to copy files without a problem, but I can't move or delete files. Is it possible this message could be generated due to a problem other than security? There is a possibility that I'm setting the perimssions wrong... I right click on the folder that the files are moved around in, click security tab, give appropriate users modify permissions, then I click advanced, then click view/edit, and check the delete box. I also make sure that it says apply to: "this folder, subfolders and files".
I have triple checked that the paths are corresponding to eachother correctly when I try to move the file. Here are the paths:
Move From:
G:\WebServer\cpthandler\SVGgraph\CPT Archive\temp\02-248.CPD
Move To:
G:\WebServer\cpthandler\SVGgraph\CPT Archive\2002 CPT Data\07-195901\02-248.CPD
If you want me to post my code, let me know.
Thanks for any help.
Paul