Quantcast
Channel: Classic ASP
Viewing all articles
Browse latest Browse all 488

Need a little help with create folder dynamically

$
0
0

Just learning Classic ASP

I have some classic ASP code that creates a new folder on the server when you click the button.

Works fine, but I want to make it just run as code (process when the page loads) - so no button.

Can someone help?

The created Folder is named via a variable from database (works fine) variable is 'pRef'.

CreateFolder(Server.MapPath("documents/ "&pRef&" "))
Dim objFso
'# CREATE FOLDER
function CreateFolder(fdirCRE)
Set objFso = CreateObject("Scripting.FileSystemObject")
if Not objFso.FolderExists(fdirCRE) Then
objFso.CreateFolder(fdirCRE)
Else
Exit function
End if
Set objFso = nothing
End function

Here is the html button to make it work.

<input type="button" ID="buttonCreateFolder" value="Create Folder" OnClick="CreateFolder()" />

Thanks in advance


Viewing all articles
Browse latest Browse all 488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>