Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

File System Object and ASP

Options
  • 11-02-2004 8:26pm
    #1
    Registered Users Posts: 7,097 ✭✭✭


    hey all

    I have a problem with ASP and the File system object!

    I want to be able to create a folder in asp! I want whatever I type in the form to be the name of the new folder. But I'm having problems ...

    here's my code if anyone can help!

    folder.html
    <html>

    <form name="folder" action="folder.asp" method="get">
    <input type="text" cname="fold">
    <input type="submit" value="Login">
    </form>

    </html>



    Folder.asp
    <%

    strcname = Request.Form("cname")

    Dim objFSO, cname
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    objFSO.CreateFolder("C:\& cname &")

    %>


    I can't figure out the problem. I know it's something to do with the &cname&!

    thanks in advance,
    mada!


Comments

  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    Read, re-read and then read again.. your naming was off.. My changes in bold below..
    Originally posted by mada999
    folder.html
    <html>

    <form name="folder" action="folder.asp" method="get">
    <input type="text" name="cname">
    <input type="submit" value="Login">
    </form>

    </html>



    Folder.asp
    <%

    strcname = Request.Form("cname")

    Dim objFSO, cname
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    objFSO.CreateFolder("C:\" & strcname )

    %>


Advertisement