How to Create Folders using ASP?

asp Egypt
  • 13 years ago

    Hello,

    I am working on a website and i want to use the ASP's FileSystemObject to create Folders and inside each folder some files but i am facing a lot of problems. Any help will be appriaciated.

    Regards,

    Ahmed

  • 13 years ago

    Hello,

    try the following code:

    [NewFolderName]: Name of the Folder to be created (incl. the total physical path!)


    Set ObjFSO = Server.Create("Scripting.FileSystemObject")  ' create Object
    if not ObjFS.FolderExists([NewFolderName]) then  'check , if  Folder does exist yet
       ObjFSO.CreateFolder([NewFolderName]) ' create new folder
    else
       response.write([NewFolderName] & " already exists!")
    end if





    This should work correct,...Good luck!

    Martin

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The difference between theory and practice is smaller in theory than in practice.”