View Full Version : Create new folder ?
wanye
11-06-2002, 07:11 AM
Hi, how to create new folder n name it using request.form in web directory..??
glenngv
11-06-2002, 07:25 AM
if you already know how to create a folder using FileSystemObject, there should be no problem of creating one with the name coming from a request.form.
<%
dim filesys, newfolder, newfolderpath
newfolderpath = "c:\myfolder\" & request.form("element_name")
'or you can use:
'newfolderpath = server.mappath("/virtualdir/" & request.form("element_name"))
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
Response.Write("A new folder has been created at: " & newfolderpath)
End If
%>
and you may want to check first for valid folder names before creating it.
whammy
11-07-2002, 12:09 AM
Yet again, I post a link to the best site on the internet (aside from javascriptkit.com, that is ;)):
http://www.w3schools.com/asp
:D
All of your FileSystemObject questions should be easily figured out there, just go through the examples. Thanks to my study there I have saved myself countless hours of time by writing FSO scripts in VBScript (using it locally in conjunction with ODBC data sources to connect with a network database) or ASP/VBScript to do what I want.
And I get to write another one tomorrow. Yay! :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.