How to create a file in ASP?

by 7 replies
8
I have done some reasearch on how to create files
in ASP and found this script:
<%
thetext="Write this text in the file"

Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.CreateTextFile("", True)
wfile.Write (thetext)
wfile.close
Set wfile=nothing
Set fs=nothing response.write("Text created")
%>

then I created an asp file containing only this script, named it
"create" and uploaded it on one account on one asp-supporting
free host. Then I tried to open that file using my IE6 browser
and received an error message. Then I checked my file manager
(on that free account) and saw that a new file (''myfile.txt") was
not created. I think I am missing something here. Can anyone,
please, explain to me what should I do in order to create files in ASP?
#programming #asp #create #file
  • Banned
    [DELETED]
    • [1] reply
    • Are you sure you posted this in the right thread? It seems to me that you were answering some other question, but not mine.
      • [1] reply
  • Banned
    I don't really know ASP.
    But try to change the folder's permissions.
    "CHMOD" the folder to 0777.
    and also check if there is any command in ASP to chmod files,
    because maybe you need to chmod the new file that created before writing something in it.
    • [1] reply
  • Thanks for telling me that - finally I know the reason.

Next Topics on Trending Feed