I am wrote a file del.asp where I am deleting a file but I am getting the following error

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied
/asptreeview/del.asp, line 9

The code which I wrote is as follows...

PhotoFile = "/asptreeview/asptree/" & Request.QueryString("file")(1)
PhotoPath = Server.MapPath(PhotoFile)
Response.Write(PhotoPath & "<br />")

dim ServerFSO
Set ServerFSO=Server.CreateObject("Scripting.FileSystemObject")
if ServerFSO.FileExists(PhotoPath) then
ServerFSO.DeleteFile(PhotoPath)
end if
set ServerFSO=nothing

what is the problem ...can anyone help me???

You will need to give full control to the Folder where the file resides to the IUSR_<machineName> (Where machine name is the name of your computer) user account.

How to give full control can u give step by step process.......

>>How to give full control
Right Click the folder in question > Properties > Security tab > IUSR_machineName

Let permissions propagate to sub-folders as well

I dont see security tab in folder properties I see the following tabs..
general , sharing , websharing , customize I am using windows XP

1. Open Windows Explorer, and choose Folder Options from the Tools menu.

2. On the View tab, scroll to the bottom of the Advanced Settings and clear (click) the check box next to "Use Simple File Sharing."

3. Click OK to apply the change, and you should now have a Security tab when viewing the properties of a file on an NTFS volume.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.