Click to See Complete Forum and Search --> : Error: Permission Denied


Capricorn
10-13-2003, 11:28 PM
I have problem copying file to a newly created folder. The error is Permission Denied. Can someone tell me how am I going to fix this problem? I need help urgently.

Below is my codes:

<%
Dim FSO, copiedfilepath, file

Set FSO = Server.CreateObject("Scripting.FileSystemObject")


copiedfilepath = "C:\Inetpub\wwwroot\MyProj\contentProvider"


If NOT FSO.FolderExists(copiedfilepath & "\" & session("login")) Then
FSO.CreateFolder(copiedfilepath & "\" & session("login"))

Set file = FSO.GetFile("C:\Inetpub\wwwroot\MyProj\AUDIO.asp")
file.Copy(copiedfilepath & "\" & session("login"))

Response.Write "Successfully Registered.<br>"
Response.Write "Folder has been created in ' " & copiedfilepath & " '<br>"
Response.Write "Folder name is called ' " & session("login") & " '"

Else

Response.Write "The login id is already in used"

End If

Set file = nothing
Set FSO = nothing

%>

rdoekes
10-15-2003, 03:10 AM
You need to give your anonymous IIS user (IUSR_[machine_name]), read and write permissions to the filesystem starting at the contentprovider directory in order to make this work.

Essentially, the IIS user is not allowed to create this folder due to security restrictions.