Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to save file "as"

Status
Not open for further replies.

codeone

Programmer
Mar 25, 2003
343
US
hello Im trying to save the text in a text area and I would like to be able to specify the name of the txt file, I suppose I would use a prompt but i have no clue how to do this...

if anyone feels like giving me a script I would appreciate it..

thnks

co
 
The usual method to browse for filenames in HTML goes something like:
Code:
<html>
  <head>
    <script language=VBScript>
      Sub btnSaveAs_onclick()
        MsgBox filBrowse.value
      End Sub
    </script>
  </head>
  <body>
    <input type=button id=btnSaveAs value="Save As">
    <input type=file id=filBrowse>
  </body>
</html>
Of course you need to write out the data to be saved in your button event handler instead of just displaying it.
 
hey,
thanks for that script it works and all, but isnt what I need, Im looking to be able to specify my own name for the file thats getting svaed...sorry should have explained that better... so yeah,

just the name the file thing would be enough, and it must save the contents of the textarea.....


Code:
<html>
<head>

</head>

<body>
<form name="alpha">
<taxtarea name="txt" cols=10 rows=10></textarea>
</form>
</body>
</html>

something to look at or work with, more prefferably work with...lol
 
I don't know of any "save the text to disk" capability in HTML. You'd need to write it out via the FileSystemObject or something. Then you'd need to deal with the warnings about "unsafe for scripting" objects and all.

Or am I still missing the point?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top