Error 70 : access denied

S

Shun

Hello,

Please anybody try to execute this code. I am having a "quick.html" with
email Id and name etc..., and henext form is the below "gdform.asp".

When i try to execute this i am getting the following error. Error 70 :
Access Denied.

Please anybody can help me.

Thanks in advance.
<%



Dim landing_page, host_url
Dim fso, outfile, filename, dirname, myFolder
Dim req_method, key, value1
Dim bErr, errStr, bEmpty
On Error resume next
bErr = false
bEmpty = true
errStr = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")

host_url = Request.ServerVariables("HTTP_HOST")
response.write(host_url)

req_method = Request.ServerVariables("REQUEST_METHOD")
dtNow = Now()
filename = Server.MapPath("ssfm")
dirname = filename
filename = filename & "\gdform_" & DatePart("M", dtNow) & DatePart("D",
dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S",
dtNow)

response.write(req_method)
response.write(dtnow)
response.write(filename)
response.write(dirname)

sub FormatVariableLine(byval var_name, byVal var_value)
Dim tmpStr
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
tmpStr = tmpStr & var_value & vbCRLF
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
FormatVariableLine = tmpStr
end sub

Sub OutputLine(byVal line)
outfile.WriteLine(line)
end sub

if err.number = 0 then
response.Write("<br> Error :" & err.number &"::"&err.description & filename)
Set outfile = fso.CreateTextFile(filename, true)
response.Write(filename)
if err.number <> 0 then
bErr = true
response.Write("<br> Error :" & err.number &"::"&err.description)
errStr = "Error creating file! Directory may not be writable or may not
exist.<br>Unable to process request."
else
response.write("gaffar")
if(req_method = "GET") then
for each Item in request.QueryString
if item <> "" then
bEmpty = false
key = item
value1 = Request.QueryString(item)
if(lcase(key) = "redirect") then
landing_page = value1
else
line = FormatVariableLine(key, value1)
Call OutputLine(line)
end if
end if
next
elseif (req_method = "POST") then
for each Item in request.form
if item <> "" then
bEmpty = false
key = item
value1 = Request.form(item)
if(lcase(key) = "redirect") then
landing_page = value1
else
line = FormatVariableLine(key, value1)
Call OutputLine(line)
end if
end if
next
end if
outfile.close
end if
if(bEmpty = true) AND errStr = "" then
bErr = true
errStr = errStr & "<br>No variables sent to form! Unable to process
request."
end if
if(bErr = false) then
if (landing_page <> "") then
response.Redirect "http://" & host_url & "/" & landing_page
else
response.Redirect "http://" & host_url
end if
else
Response.Write errStr
end if
set fso = nothing
else
Response.Write " An Error Occurred creating mail message. Unable to
process form request at this time."
end if
%>
 
D

Dave Anderson

Shun said:
When i try to execute this i am getting the following error.
Error 70 : Access Denied.

You don't state which line the error occurs on, so I will guess. It has to
be one of these:
Set fso = Server.CreateObject("Scripting.FileSystemObject")
filename = Server.MapPath("ssfm")
outfile.WriteLine(line)
Set outfile = fso.CreateTextFile(filename, true)
outfile.close

In all likelihood, you need to grant some file-level permissions to your
SYSTEM or IUSR_xxx account.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,039
Messages
2,570,376
Members
47,028
Latest member
IsmaelLans

Latest Threads

Top