Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

File System Object and ASP

  • 11-02-2004 07:26PM
    #1
    Registered Users, Registered Users 2, Paid Member Posts: 7,251 ✭✭✭


    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, Registered Users 2 Posts: 3,890 ✭✭✭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