mscproj
asked on
File Object Permission
I'm making an admin screen so that the administrator can change the content of file remotely anywhere.
But, I got the following error
D:\WWW HOSTING\ABC\Mullin\test\ad rot.txt
Microsoft VBScript runtime error '800a0046'
Permission denied
Set FileObject = Server.CreateObject("Scrip ting.FileS ystemObjec t")
adrotfile = (Server.MapPath("\Mullin\t est") + "\adrot.txt")
Response.Write adrotfile & "<br>" & "<br>"
' For Appending
Set AppendStream = FileObject.OpenTextFile(ad rotfile, ForAppending, False, 0)
' For Reading
Set InStream = FileObject.OpenTextFile(ad rotfile, ForReading, False, 0)
' For Overwriting
FileObject.DeleteFile(adro tfile)
Set OutStream = FileObject.CreateTextFile( adrotfile, True, False)
End If
The error states that no permission to run
FileObject.DeleteFile and I got another error that I have no permission to run
FileObject.CreateTextFile( adrotfile, True, False)
However, I can append content to the text file, but not create or overwrite.
What can I do?
I've already set the permission to Full Control to EveryOne
Thanks!
But, I got the following error
D:\WWW HOSTING\ABC\Mullin\test\ad
Microsoft VBScript runtime error '800a0046'
Permission denied
Set FileObject = Server.CreateObject("Scrip
adrotfile = (Server.MapPath("\Mullin\t
Response.Write adrotfile & "<br>" & "<br>"
' For Appending
Set AppendStream = FileObject.OpenTextFile(ad
' For Reading
Set InStream = FileObject.OpenTextFile(ad
' For Overwriting
FileObject.DeleteFile(adro
Set OutStream = FileObject.CreateTextFile(
End If
The error states that no permission to run
FileObject.DeleteFile and I got another error that I have no permission to run
FileObject.CreateTextFile(
However, I can append content to the text file, but not create or overwrite.
What can I do?
I've already set the permission to Full Control to EveryOne
Thanks!
ASKER
As I told you on my question, even I remark the Delete statement, still "Permission Denied", it seems that I can't CreateTextFile
My latest code is
<%
Set FileObject = Server.CreateObject("Scrip ting.FileS ystemObjec t")
adrotfile = (Server.MapPath("\abc\test ") + "\adrot.txt")
'adrotfile = "http://www.intern.com/abc/test/adrot.txt"
Response.Write adrotfile & "<br>" & "<br>"
' For Appending
Set AppendStream = FileObject.OpenTextFile(ad rotfile, ForAppending, False, 0)
' For Reading
Set InStream = FileObject.OpenTextFile(ad rotfile, ForReading, False, 0)
' For Overwriting
If Request("Action") = "Remove" Or Request("Action") = "Edit" Then
'FileObject.DeleteFile(adr otfile)
Set OutStream = FileObject.CreateTextFile( adrotfile, True, False)
End If
The error statement is pointing to
Set OutStream = FileObject.CreateTextFile( adrotfile, True, False)
Error Message
Microsoft VBScript runtime error '800a0046'
Permission denied
My latest code is
<%
Set FileObject = Server.CreateObject("Scrip
adrotfile = (Server.MapPath("\abc\test
'adrotfile = "http://www.intern.com/abc/test/adrot.txt"
Response.Write adrotfile & "<br>" & "<br>"
' For Appending
Set AppendStream = FileObject.OpenTextFile(ad
' For Reading
Set InStream = FileObject.OpenTextFile(ad
' For Overwriting
If Request("Action") = "Remove" Or Request("Action") = "Edit" Then
'FileObject.DeleteFile(adr
Set OutStream = FileObject.CreateTextFile(
End If
The error statement is pointing to
Set OutStream = FileObject.CreateTextFile(
Error Message
Microsoft VBScript runtime error '800a0046'
Permission denied
ASKER
Sorry, your answer gives me some insights and I solve it at last.
Therefore, please post your answer again for the points!
Cheers!
Therefore, please post your answer again for the points!
Cheers!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
....
Set AppendStream = Nothing
Set InStream = Nothing
FileObject.DeleteFile(adro
....