asp writing text files at server - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

asp writing text files at server

I'm new to web programming. I've followed an example in a book...but can't get this to work for me. This asp file is called by a form in an html file. The data sent to this file will print out with 'response.srite'...but, I can't save the file to the server.

<%

option explicit


dim FSO
dim objStream
dim strText
dim strComment

const TristateFalse = 0


set FSO=createobject("Scripting.filesystemobject")

strText = request.form("title") & ".txt"

strComment = request.form("comment")


Set objStream = FSO.CreateTextFile(strText , True, TristateFalse)

With objStream

.WriteLine strComment
.close

End With


set FSO=nothing
set objStream=nothing
set strText=nothing
set strComment=nothing




%>

Comments

  • FlakesFlakes Posts: 642Member
    Are you getting any errors ? If so, show the error

    To create a file on the server through asp code, the IUSR_xxxx user( where xxxx is the name of the server) should have write permission in the folder that the file is to be created.
Sign In or Register to comment.