SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Feb 2014
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Open form page from network drive and save on the netwotk drive

    Hi
    I am new user I want to open file on network drive like \\10.30.50.88\project\test\product\Daily\Reports\form.html and try to save on \\10.30.50.88\project\test\product\Daily\Reports\data.txt

    But when Click on submit button it show error message
    Error: Number:-2146827859 Description:Automation server can't create object
    Please help me out . I want to replace “d:\\data.txt “ with “\\10.30.50.88\project\test\product\Daily\Reports\data.txt “

    Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Name</title>
    <SCRIPT LANGUAGE='JavaScript'> 
    function WriteToFile() {
    try {
    var fso, s;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    s = fso.OpenTextFile("d:\\data.txt" , 8, true, 0);
    s.writeline(document.ietmdata.name.value + ", " + document.ietmdata.email.value + ", " + document.ietmdata.location.value + ", " + document.ietmdata.type.value );
    s.Close();
    }
    catch(err){
    var strErr = 'Error:';
    strErr += '\nNumber:' + err.number;
    strErr += '\nDescription:' + err.description;
    document.write(strErr);
    }}
    
    </SCRIPT> </head>
    <BODY>
    <form action="test.hta" method="post" name="ietmdata" >
    Name: input type = "text" name="name"<br>
    Email: input type="text" name="email"<br>
    Location: input type = "text" name="location"<br>
    Type: <select name="type" >
    <option value="Software"> Software </option>
    <option value="Hardware"> Hardware </option>
    </select>
    <br><br>
    <INPUT TYPE=BUTTON VALUE="Submit Data to Text File"  önClick="WriteToFile(this.form)">
    </form>
    </body></html>
    Last edited by Pullo; Feb 25, 2014 at 13:14. Reason: Added code tags


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •