SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Save to server function

    I'm building up ASP web page and need help with saving asp page.

    Script should save current page to the current server directory.
    User should be able to write name for the asp file.

    How could i do that?
    I don't not know how to write ASP codes myself.

  2. #2
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <%
    Dim objfso,objfile
    
        set objfso=Server.CreateObject("Scripting.FileSystemObject")
    
        set objfile=objfso.CreateTextFile("C:\" & Request.Form("filename") & "") 'Change filename to the name of your form make sure to include the file extention
              objfile.WriteLine("" & Request.Form("text") & "") 'Change the form here to the name of the text to save
              objfile.close
    
    set objfile=nothing
    set objfso=nothing
    
    %>

    http://www.w3schools.com provides information, help and examples using many differnet languages.


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
  •