473,509 Members | 10,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

files

I would like to capture the data from a textarea box and save it to a file.
Can you advise?

Kevin
Sep 12 '06 #1
5 1205
"Kevin Raleigh" <kr******@sbcglobal.netwrote in message
news:9a******************************@giganews.com ...
I would like to capture the data from a textarea box and save it to a
file.
Can you advise?

Will this help? Watch for word-wrap.

<%@ Language = "VBScript" %>
<% Option Explicit
'*
Const cASP = "areafile.asp"
Const cOTF = "areafile.txt"
'*
Dim strTXT
strTXT = Request.Form("Area")
If strTXT <"" Then
Call Area()
Response.Write strTXT
Response.End
End If

Sub Area()
Dim strOTF
strOTF = Server.MapPath(cOTF)
Dim objFSO
Dim objOTF
'*
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objOTF = objFSO.OpenTextFile(strOTF,2,True)
objOTF.Write(strTXT)
Set objOTF = Nothing
Set objFSO = Nothing
End Sub
%>
<html>
<head>
<title><%=cASP%></title>
</head>
<body>
<form action="<%=cASP%>" method="post">
<textarea name="Area" cols="50" rows="6">Hello World</textarea>
<input type="submit" value="Submit">
</form>
</body>
</html>
Sep 12 '06 #2
I tried the script you gave me by just typing text into the text box and
submiting.
I created the txt file areafile.txt and placed it in the same directory. At
least this is the way that I read your code.
Did I miss read it?
Server 500 error pops on submit and the textfile is blank?

Kevin
"McKirahan" <Ne**@McKirahan.comwrote in message
news:mJ******************************@comcast.com. ..
"Kevin Raleigh" <kr******@sbcglobal.netwrote in message
news:9a******************************@giganews.com ...
I would like to capture the data from a textarea box and save it to a
file.
Can you advise?


Will this help? Watch for word-wrap.

<%@ Language = "VBScript" %>
<% Option Explicit
'*
Const cASP = "areafile.asp"
Const cOTF = "areafile.txt"
'*
Dim strTXT
strTXT = Request.Form("Area")
If strTXT <"" Then
Call Area()
Response.Write strTXT
Response.End
End If

Sub Area()
Dim strOTF
strOTF = Server.MapPath(cOTF)
Dim objFSO
Dim objOTF
'*
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objOTF = objFSO.OpenTextFile(strOTF,2,True)
objOTF.Write(strTXT)
Set objOTF = Nothing
Set objFSO = Nothing
End Sub
%>
<html>
<head>
<title><%=cASP%></title>
</head>
<body>
<form action="<%=cASP%>" method="post">
<textarea name="Area" cols="50" rows="6">Hello World</textarea>
<input type="submit" value="Submit">
</form>
</body>
</html>


Sep 13 '06 #3
"Kevin Raleigh" <kr******@sbcglobal.netwrote in message
news:_M******************************@giganews.com ...
I tried the script you gave me by just typing text into the text box and
submiting.
I created the txt file areafile.txt and placed it in the same directory.
At
least this is the way that I read your code.
Did I miss read it?
Server 500 error pops on submit and the textfile is blank?
Does it or does it not do what you want?

I can't tell from what you wrote.

After it generates the file it just displays the text and exits per:

Response.Write strTXT
Response.End
Sep 13 '06 #4
And what, precisely, was the nature of the Server 500 error. Which
line in the code caused the problem? Have you set permissions on the
folder you want to write to correctly?

http://classicasp.aspfaq.com/general...sp-errors.html
http://classicasp.aspfaq.com/files/d...temobject.html

--
Mike Brind

Kevin Raleigh wrote:
I tried the script you gave me by just typing text into the text box and
submiting.
I created the txt file areafile.txt and placed it in the same directory. At
least this is the way that I read your code.
Did I miss read it?
Server 500 error pops on submit and the textfile is blank?

Kevin
"McKirahan" <Ne**@McKirahan.comwrote in message
news:mJ******************************@comcast.com. ..
"Kevin Raleigh" <kr******@sbcglobal.netwrote in message
news:9a******************************@giganews.com ...
I would like to capture the data from a textarea box and save it to a
file.
Can you advise?

Will this help? Watch for word-wrap.

<%@ Language = "VBScript" %>
<% Option Explicit
'*
Const cASP = "areafile.asp"
Const cOTF = "areafile.txt"
'*
Dim strTXT
strTXT = Request.Form("Area")
If strTXT <"" Then
Call Area()
Response.Write strTXT
Response.End
End If

Sub Area()
Dim strOTF
strOTF = Server.MapPath(cOTF)
Dim objFSO
Dim objOTF
'*
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objOTF = objFSO.OpenTextFile(strOTF,2,True)
objOTF.Write(strTXT)
Set objOTF = Nothing
Set objFSO = Nothing
End Sub
%>
<html>
<head>
<title><%=cASP%></title>
</head>
<body>
<form action="<%=cASP%>" method="post">
<textarea name="Area" cols="50" rows="6">Hello World</textarea>
<input type="submit" value="Submit">
</form>
</body>
</html>
Sep 13 '06 #5
"McKirahan" <Ne**@McKirahan.comwrote in message
news:LP******************************@comcast.com. ..
"Kevin Raleigh" <kr******@sbcglobal.netwrote in message
news:_M******************************@giganews.com ...
I tried the script you gave me by just typing text into the text box and
submiting.
I created the txt file areafile.txt and placed it in the same directory.
[snip]

Do you mean you manually created it?
If so, you don't have to as this statement recreates it each time:

Set objOTF = objFSO.OpenTextFile(strOTF,2,True)
Sep 13 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14146
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
3992
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
0
6076
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
18
3142
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now...
3
3078
by: pooja | last post by:
Suppose i have created a class c1 with f1()in c1.cpp and included this c1.cpp in file1.cpp file , which is also having main() by giving the statement #include "c1.cpp". the same i can do by...
11
5548
by: ambika | last post by:
Iam just trying to know "c". And I have a small doubt about these header files. The header files just contain the declaration part...Where is the definition for these declarations written??And how...
22
2977
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
18
2272
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
0
1499
by: wal | last post by:
How does one attach files to emails using libgmail? The following code http://pramode.net/articles/lfy/fuse/4.txt works fine when said files are simple text files, but it failes as soon as the...
3
5157
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.