Ctl_e_permissiondenied

Joined
Feb 26, 2008
Messages
2
Reaction score
0
I have two APS .NET applications running on the same server.
Both applications create folders and upload files inside the same virtual folder (they both use the same code - see below).

The first application doesn't request authentication to log in and it is available for anybody outside (no NT Authentication). This application works perfect.


The second application requests windows authentication (internal use only). When i run this application from my localhost it allows me to upload files without problem but when I deploy the application on the server and acces it through the web (intranet) it gives me the following error when trying to upload:


Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED)-
Error String:System.Security.SecurityException:
Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED)
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall
(Object o, Type objType, String name, Object[] args,
String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall
(Object Instance, Type Type, String MemberName, Object[] Arguments,
String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack,
Boolean IgnoreReturn) at logConversation.FilesUpload()
The Zone of the assembly that failed was: MyComputer


Both folders/permissions/applications have the same setting/permissions.

I tried changing the trust levet to "Full" on my webconfig file but didn't work.


Any help will be appreciated.






--------------------------------------------------------
Code

Sub FilesUpload()

Dim strPath As String = "\\virtualServ\folderName\"
Dim uploads As HttpFileCollection = HttpContext.Current.Request.Files
Dim upload As HttpPostedFile
Dim objFSO As Object = Server.CreateObject("Scripting.FileSystemObject")


If uploads.Count >= 1 Then


Dim i As Integer = 0

Do While i <> uploads.Count
upload = uploads(i)

If (upload.ContentLength <> 0) Then


If Not objFSO.FolderExists(strPath & (Replace(strUserEmail, " ", "_"))) Then
objFSO.CreateFolder(strPath & (Replace(strUserEmail, " ", "_")))
end if

strFileName = System.IO.Path.GetFileName(upload.FileName)
upload.SaveAs(strPath & (Replace(strUserEmail, " ", "_")) & "\" & strFileName)

End If
i = i + 1
Loop

End If


End sub
 
Joined
Feb 26, 2008
Messages
2
Reaction score
0
Got it

I just set the impersonation to false on my webconfig:

<system.web>
<identity impersonate="false"/>
</system.web>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top