|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have read everything I can find in the cfm book to output from a form into a text file. The book describes how to do it roughly with the following code; <cffile action="write" file ="c:\temp\textfile.txt" output ="getlog" addnewline="yes"> I am a bit stuck on how to get the form fields to use this code. How do I input into the file from my form? Do I use <cfoutput> to dispaly the data once it has been input into the text file? Thanks Peter |
|
#2
|
|||
|
|||
|
Your form fields are available in the form scope. So if you had a field called "firstName", you could use it in the CFFILE tag like this:
<cffile action="write" file ="c:\temp\textfile.txt" output ="#form.firstName#" addnewline="yes"> You read the file using cffile action="read". I would get a better book, because every CF book I've ever seen covers this in great detail. Even the LiveDocs have examples of this, using form fields no less: http://livedocs.macromedia.com/cold...7.htm#wp1098395 |
|
#3
|
|||
|
|||
|
thanks
Very helpful as always. thanks
|
|
#4
|
|||
|
|||
|
More then a variable..
Is it possible to write more then a variable?
For example, I'd like to be able to have CF write entire Javascripts on the fly to specified files.. Since the scripts are more then one line, writting a single variable for it seems tedious. Is it possible to dump everything between 2 <cfoutput> tags to a variable? Or somehow write more then 1 line to a file? Thanks! |
|
#5
|
|||
|
|||
|
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#6
|
|||
|
|||
|
Thanks a ton, Kiteless!
Can't belive I never saw that... ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Writing to text file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|