I have the following ASP:
The error point to line in red. I have tried several times changing the location like this:
set tfile=fs.CreateTextFile("www/somefile.txt")
set tfile=fs.CreateTextFile("/somefile.txt")
set tfile=fs.CreateTextFile("somefile.txt")
I always get this error:
Microsoft VBScript runtime error '800a0046'
Permission denied
/asp_createfile_example_2.ASP, line 7
I know what permission denied means I just don't understand why I don't have permission.
If permission is denied for me then it would be denied for anyone so what is the point of having an ASP if it isn't going to allow creating a file which is exactly what I want the user to do.
I wrote a Perl script to do the same thing and it allows users to create the file. Both Perl and ASP are server side scripts.
EDIT
BTW, I have permission set as 777
Code:
<!DOCTYPE html>
<html>
<body>
<%
dim fs,tfile
set fs=Server.CreateObject("Scripting.FileSystemObject")
set tfile=fs.CreateTextFile("/www/somefile.txt")
tfile.WriteLine("Hello World!")
tfile.close
set tfile=nothing
set fs=nothing
%>
</body>
</html>
set tfile=fs.CreateTextFile("www/somefile.txt")
set tfile=fs.CreateTextFile("/somefile.txt")
set tfile=fs.CreateTextFile("somefile.txt")
I always get this error:
Microsoft VBScript runtime error '800a0046'
Permission denied
/asp_createfile_example_2.ASP, line 7
I know what permission denied means I just don't understand why I don't have permission.
If permission is denied for me then it would be denied for anyone so what is the point of having an ASP if it isn't going to allow creating a file which is exactly what I want the user to do.
I wrote a Perl script to do the same thing and it allows users to create the file. Both Perl and ASP are server side scripts.
EDIT
BTW, I have permission set as 777