Jim
05-21-2003, 03:25 AM
I'm using a richtext editor to allow a user to modify blocks of code within his site. I've used this technique before but now I'm getting Permission denied when I try to write the file back to the site? I think the code is good... I've used it on another ISP... The red line is where I'm getting the error.
Here is the code:
************************************************** ********************
Dim fs , f , f2, txtData, optTxt, txtRead, fread, gdata, i1,rsSelect
tfilename = Trim(Request.Form("FileName"))
' response.write(" Updated = " & Server.MapPath(tfilename))
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If fs.FileExists(tfilename)=false and tfilename <> "" Then
Set f=fs.CreateTextFile(Server.MapPath(tfilename),true )</font id="red">
txtData=Trim(Request.Form("text"))
Session("strData")=txtData
response.write(txtData)
f.writeline(txtData)
f.close
' response.write(tfilename & " Updated")
Set f=Nothing
Set fs=Nothing
end if
************************************************** *******************
Here is the code:
************************************************** ********************
Dim fs , f , f2, txtData, optTxt, txtRead, fread, gdata, i1,rsSelect
tfilename = Trim(Request.Form("FileName"))
' response.write(" Updated = " & Server.MapPath(tfilename))
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If fs.FileExists(tfilename)=false and tfilename <> "" Then
Set f=fs.CreateTextFile(Server.MapPath(tfilename),true )</font id="red">
txtData=Trim(Request.Form("text"))
Session("strData")=txtData
response.write(txtData)
f.writeline(txtData)
f.close
' response.write(tfilename & " Updated")
Set f=Nothing
Set fs=Nothing
end if
************************************************** *******************