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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write to file, pull information from file 2

Status
Not open for further replies.

TempestT37

Programmer
May 19, 2003
15
0
0
US
Hello Group
I need a form that will reside on the client computer.
This form will save a file on the client’s computer that will need to be read from later.

The form will be filled out on employee’s laptops while off line. When they return to the office they will get online, login in to the company web site and go to a form that is identical to the form that resides on their computer, grab the file that was saved earlier and auto load the information into this online form, then upload to a database.

I have the online form adding to the database already done and will use the same form for the employees computer.
I have read that JavaScript cannot write to a text file unless it is a cookie, so can a cookies be uploaded to fill out the form? Or is there a better way to do what I am trying to do?
The employee’s laptops OS range from win98 to winXP and our site host supports asp and aspupload.
TIA
Michael
 
cookies have a storage limit of about 4k

one option would be to use vbscript in a .hta file. an .hta is an html application - it is a trusted application, so it won't ask about activex objects that want access to the filesystem:

save as file.hta[tt]
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
<html>
<head>
<title>write to file</title>
<script type=&quot;text/vbscript&quot;>
sub writeToFile(s)
set oFS = createobject(&quot;scripting.filesystemobject&quot;)
set oFile = oFS.opentextfile(&quot;c:\temp\file.txt&quot;, 8, true)
oFile.writeline(s)
oFile.close()
set oFile = nothing
set oFS = nothing
end sub
</script>

<meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;>
<meta http-equiv=&quot;Pragma&quot; content=&quot;no-cache&quot;>
</head>

<body>
<form>
<textarea name=&quot;ta&quot; rows=&quot;10&quot; cols=&quot;50&quot;></textarea>
<p/>
<input type=&quot;button&quot; value=&quot;save&quot; onclick=&quot;writeToFile(document.forms(0).ta.value);&quot; />
</form>
</body>
</html>
[/tt]

more info on HTA:



=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Jemminger, Take a star for introducing me to yet another thing that I was unaware of.

I had hoped that I could use an hta file to launch an exe locally. I tried:

<a href=&quot;c:\mydir\myapp.exe&quot;>launch MyApp</a>

but alas it still propmted me with the download or run screen. Can you think of any other way to launch an exe locally?

Clive
 
Thanks Jeff, Couldn't get the shell call to work however I did find something else in another thread from BIGBADDAVE that helped me come up with this.

<object classid=&quot;CLSID:018B7EC3-EECA-11d3-8E71-0000E82C6C0D&quot; codebase=&quot;c:\mydir\myapp.exe&quot;></object>

I would feel more comfortable if I new what the classid paramater meant and whether it would need to be different for different exe's.

Anyone??

Clive
 
Jeff
Thank you for the neat idea. The only way I got it to work was remove the button and go to a computer that did not have Norton installed, Norton would block the script even when I disabled Norton.
Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top