Delete.Folder - permission denied (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


bobby -> Delete.Folder - permission denied (6/24/2004 0:33:41)

I'm using a basic FSO script to delete a folder on the web... but it's not working.

If I use this statement:
'Delete the file

if oDelete.FolderExists (server.mappath("\" & sold)) then
   oDelete.DeleteFolder (server.mappath("\" & sold)), true
else 
   response.redirect ("page.asp")
end if


I get this error:
 Microsoft VBScript runtime error '800a0046' Permission denied


And if I switch the file path to this:
'Delete the file

if oDelete.FolderExists ("E:\Inetpub\domain.com\" & sold) then
   oDelete.DeleteFolder ("E:\Inetpub\domain.com\" & sold), true
else 
   response.redirect ("page.asp")
end if


I get this error:
Server object error 'ASP 0177 : 800a0046'

Server.CreateObject Failed

/solditem.asp, line 71

The operation completed successfully. 


Is there a server permission that needs to be set to allow for deleting a file or folder? I've played around, and everything else works fine in FSO on this server... just not DELETE

On another site I run, I've used this same script and it works fine... I just asked the host to set up FSO permissions.

Very frustrating... any ideas?

(The server is IIS 5)




fatlardo -> RE: Delete.Folder - permission denied (6/24/2004 3:55:45)

I've had a similar problem with one of my websites. Try setting permissions for everyone to have full control, this should allow your website to delete the folder. Also do the same to any files inside. Im not sure if it'll work but it should be worth a try.




bobby -> RE: Delete.Folder - permission denied (6/24/2004 11:01:30)

It looks like that will do it, thanks fatlardo!




dpf -> RE: Delete.Folder - permission denied (6/24/2004 11:05:48)

quote:

thanks fatlardo

I know a few people I have secretly wanted to say that to...lol




bobby -> RE: Delete.Folder - permission denied (6/30/2004 16:40:42)

just a little update in case it helps anybody...

Server permissions only changed the error. In order to fix this, I had to change the name of the cookie.

Once that was done, things started working fine again. Though the database had to be compacted / repaired...

[8|]




SerenityNet -> RE: Delete.Folder - permission denied (6/30/2004 19:49:37)

I know you've got it solved, but just in case it is useful, I have some input.

I've used the following code as an SSI successfully on several sites. I like it, because I don't have to get the host to change permissions on any directory.

Andrew


<%
'does the session know the user?
UserID=Session("UserID")
If IsEmpty(UserID) Or IsNull(UserID) Or UserID="" Then
	'we need authentication -- is the browser authenticated?
	UserID=Request.ServerVariables("LOGON_USER")
	If IsEmpty(UserID) Or IsNull(UserID) Or UserID="" Then
		'nope. reply with a 401
		Response.Status="401 Access Denied"
		Response.Status="401 Access Denied"
%>
<% response.write "<br><br><br><b>       Sorry, but your username and password combination was incorrect."
   response.write "<br><br>       Press your refresh button to try again.</b>"
%>
<%
		Response.End
	Else
		'yes, they're authenticated 
		'Translate to DOMAIN/USER format, adding default domain if necessary
		UserID=Replace(UserID, "\", "/")
		If InStr(UserID, "/")<1 Then
			UserID="defaultdomain/" & UserID
		End If
		'now tell the session about it
		Session("UserID")=UserID
	End If
End If
%>




bobby -> RE: Delete.Folder - permission denied (7/1/2004 11:45:40)

I just may have to give that a shot..

thanks
[;)]




SerenityNet -> RE: Delete.Folder - permission denied (7/1/2004 13:30:45)

Let me know how it works for you. So-far-so-good for me, but I'm still learning this NTLM stuff.

Andrew


PS. Of course you have to be using IE. [:o]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875