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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.