Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Creating files
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating files

 Post Reply Post Reply Page  <12
Author
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2004 at 3:50am
Ok, firstly youve dimmed strfilename but not set it to anything. And on the line "Set wfile = fs.CreateTextFile("strfilename", True)" you have put quotation marks around strfilename...  Remove them. The error your getting will probably be  caused by incorrect NTFS permissions on the folder that you are trying to write to. But since you haven'y posted the error I cannot be sure. There is a tutorial on this site about setting permissions (it's aimed at access database but its the same concept) take a look at that if you are not sure what to do.
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2004 at 5:39am
oh sorry, forgot to tell you that FSO needs the full phusical path on the server. try this code..

<%
Dim strfilename
Dim Story

filename = Request.Form("fieldname")
Story = Request.Form("story")

Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.CreateTextFile(Server.MapPath("stories/" & strfilename), True)

wfile.Write(Story)

wfile.close
Set wfile=nothing
Set fs=nothing

response.write("Text created")
%>

If you havn't specified an extension for the file in the filename textbox add & ".<extension>" after strFilename: Set wfile = fs.CreateTextFile(Server.MapPath("stories/" & strfilename & ".txt"), True)
Back to Top
Davej2k View Drop Down
Newbie
Newbie


Joined: 20 April 2004
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Davej2k Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2004 at 4:03pm
Cheers guy's that's really helped. I might come back to this thread if I need anymore help, but what so far everything seems ok.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.