Re: Can I save a text file?
- From: "Jim" <jimmenees@xxxxxxx>
- Date: 31 Mar 2006 10:39:39 -0800
Thomas Magma wrote:
I have a simple JavaScript application that will generate some text type
data for the end user. Is it possible to have a button that will allow them
to save this information to a text file?
<!-- VBSCRIPT CODING: WORKS ONLY ON MSIE (??)-->
<!-- IT ALSO TRIGGERS AN ALERT TO AUTHORIZE ACTIVE X TO RUN -->
<script type='text/vbscript'>
'html code: <button onClick="cFi( )">Save to C Drive </button>
'set variables:
Dim objFSO, objTextFile
Dim thecode
'start function triggered onClick of button:
Function cFi( )
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
'text file is local drive and file to create that holds the data:
Set objTextFile = objFSO.CreateTextFile("c:\html-code.txt", True)
'thecode variable contains the data n your form you want to save to the
file:
thecode = newWin.document.myform.ta.value
objTextFile.WriteLine(thecode)
objTextFile.Close
End Function
</script>
.
- References:
- Can I save a text file?
- From: Thomas Magma
- Can I save a text file?
- Prev by Date: Re: Can I save a text file?
- Next by Date: one action extra
- Previous by thread: Re: Can I save a text file?
- Next by thread: A Better File Upload Poller using Python, AJAX Prototype, & JSON
- Index(es):