I am having a asp web page..in that i am having upload options...if the user enters the invoice number and they redirect to upload page..from there they upload all the documents of that particular invoice and it saved in a path which i gave it in the code..
What i need now is i need to generate folder in the name of that invoice number of the user entered and all the uploaded document will be saved in that folder..
I need to check if a directory exists, and if not then create it.but I am struggling with how to do this in classic ASP.
any help is really appreciated
this is my asp code
Public Sub SaveToDisk(sPath)
Dim oFS, oFile
Dim nIndex
If sPath = "" Or FileName = "" Then Exit Sub
If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If Not oFS.FolderExists(sPath) Then Exit Sub
Set oFile = oFS.CreateTextFile(sPath & FileName, True)
For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next
oFile.Close
End Sub