Results 1 to 3 of 3

Thread: Javascript write to file

  1. #1
    HowardAllen is offline Senior Member
    Join Date
    Dec 2009
    Posts
    196
    Rep Power
    4

    Default Javascript write to file

    I am developing a web page where user enters their name and that name should be saving in a text file. Whenever users clicks on submit every time entered name should be save in text file. If you are having any useful codes related this topic then reply me. It can helpful to me.

  2. #2
    MyersGray is offline Senior Member
    Join Date
    Dec 2009
    Posts
    197
    Rep Power
    4

    Default

    Code:
    fh = fopen(getScriptPath(), 0 ); // Open the file for reading
    if (fh!=- 1 ) // If the file has been successfully opened
    {
        length = flength(fh);       
        str = fread(fh, length);     
        fclose(fh);                     
        write(str);    
    }
    **)
    I have tried the given code but it didn’t solve my problem. Please try to provide some other solution.

  3. #3
    SullivanWalker is offline Senior Member
    Join Date
    Dec 2009
    Posts
    189
    Rep Power
    4

    Default

    Code:
    function WriteToFile() {
    try {
    var fso, s;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    s = fso.OpenTextFile("C:\test.txt" , 8, 1, -2);
    s.writeline("This is a test");
    s.Close();
    }
    catch(err){
    var strErr = 'Error:';
    strErr += 'nNumber:' + err.number;
    strErr += 'nDescription:' + err.description;
    document.write(strErr);
    }
    }

Similar Threads

  1. Open and write text file in JAVA
    By Davismoore in forum Programming
    Replies: 2
    Last Post: 03-26-2010, 02:50 PM
  2. Paste File in Write Protected Drive(c)
    By WilsonMartin in forum Hard Disk
    Replies: 1
    Last Post: 03-05-2010, 05:35 PM
  3. JavaScript on a PHP file
    By Charley Dumas in forum Programming
    Replies: 2
    Last Post: 02-26-2010, 10:07 AM
  4. Write to the middle of a file
    By BarnesHarris in forum Programming
    Replies: 1
    Last Post: 01-23-2010, 02:57 PM
  5. The drive does not write DVD
    By Annalie Birgitta in forum Storage
    Replies: 3
    Last Post: 11-19-2009, 05:46 AM

Tags for this Thread

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
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48