CL1 webserver: <Anantsystems<Ad info>

    AspnetEmail.com   AspNetPro.com

related sites: <FREE Help> <ASP> <Asp.net> <worldwide>  
feedback: <lovethat> <hatethat> <thanks> <credits> <contact us>

Making Directory/Folder Table of Contents PrintView CL1
<Previous> Making webs automatically

Read Binary Files/Display Graphics <Next>


       


From: "Todd A. Groskreutz" <todd@gwlco.com>
Subject: [asp advanced] Directories on the "fly" in IIS 4.0?
Date: Mon, 13 Apr 1998 21:08:30 -0500

I am a web developer who is running IIS 4.0 and ASP and wants to create directories on my server "on the fly." (to store an uploaded file into a directory that relates to the LoginID.

Supposedly, there is a way to do it but I can not find it!

Has anyone done this...or know of a script that does?

Thanks in advance

Todd A. Groskreutz
www.iwebs.net


From: "Steve Nicholls" <Big.Steve@btinternet.com>
Subject: Re: [asp advanced] Directories on the "fly" in IIS 4.0?
Date: Wed, 15 Apr 1998 07:57:30 +0100

Todd,

Use the CreateFolder method of the FileSystemObject.

The following code creates a directory called APSCreatedServer off the route of the C Drive.

<%Set fs=CreateObject("Scripting.FileSystemObject")
fs.CreateFolder("C:\ASPCreatedFolder")%>

regards, Steve


From: Manohar Kamath <mkamath@niu.edu>
Subject: Re: [asp advanced] Directories on the "fly" in IIS 4.0?

Steve,

I use same method, a little differently to avoid any run-time errors.

<%
Set fs=CreateObject("Scripting.FileSystemObject")
sFolder = "C:\MyFolder"
If fs.FolderExists(sFolder) Then
Response.Write "Folder Exists"
Else
fs.CreateFolder(sFolder)
End If
%>

The extra line fs.FolderExists checks to see if the folder already exists. If you don't use the line, you might get an error like "Folder already exists"
--
Manohar Kamath
http://www.kamath.com/books Visit us !


CL1 webserver: <Anantsystems<Ad info>

    AspnetEmail.com   AspNetPro.com

related sites: <FREE Help> <ASP> <Asp.net> <worldwide>  
feedback: <lovethat> <hatethat> <thanks> <credits> <contact us>