Give too much away??
Man, anyone who can answer your question is already going to know exactly what is needed to accomplish the project.
anyway
A function to create a folder
Code:
Function CreateFolder(FolderName)
Dim objFSO
Set objFSO= Server.CreateObject("Scripting.FileSystemObject")
'Create the folder
If objFSO.FolderExists(foldername) then
CreateFolder = False
else
objFSO.CreateFolder(foldername)
CreateFolder = True
End If
End Function
A function to open a template and replace a placeholder with a value.
Code:
function SetDefaultDoc()
dim Body
Body = ReadText("/templates/def_inc.asp")
Body = Replace(Body,"[catid]",strNewCatID)
WriteFile(body)
end function
A function to create a default document in a folder.
(used in the function above)
Code:
function WriteFile(strText)
'write default doc file
dim objFSO, OpenFile
set objFSO = CreateObject ("Scripting.FileSystemObject")
set OpenFile = objFSO.CreateTextFile(Server.MapPath( strFolder) & "/" & DefaultDoc ,true)
OpenFile.Write strText
OpenFile.Close
set OpenFile = Nothing
set objFSO = Nothing
end function
Notes:
DefaultDoc is a constant that is a string value for the file name (default.asp)
strFolder is a variable set in the calling page for the folder where the files is to be created
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|