Option Explicit
'#####################################################
'# Script: UploadFolder.vbs @ G6FTPServer(3.2.0.72)
'# Author: IceMan @
tbm_iceman@hotmail.com (MSN)
'#
'# Date: 04-09-2004
'# Last Updated: 20-09-2004
'#
'# DESCRIPTION:
'# - When a user connects he gets his own
'# - Upload folder, instead of all users sharing the
'# - same folder.
'# - Now this is nice because you don't have to
'# - create lots of folders and mount each folder
'# - to a user, class or group.
'# - With this script you just make one binding and
'# - it will do the rest.
'# -
'# - When a user login, it creates a folder with
'# - the users name as foldername and bind the
'# - new folder as that users upload folder.
'# - That way users can't see what other people have
'# - uploaded and not delete them.
'# -
'# - If the folder is empty when the user Disconnects
'# - the script will delete it so that you don't have
'# - a lot of empty folders.
'# -
'# - This way you can also see what users upload.
'# *********************************
'# NOTE:
'# - Remember to set your upload dir like this:
'# -
'# - Virtual[Path]: Real[Path]:
'# - /Upload X:\Upload\$USR_ACCOUNT
'# -
'# *********************************
'# Plz don't steal my code.
'# If you do plz leave this message...
'#####################################################
'-----------------------------------------------------
' Path to your upload folder.
' NB: Format must be closed with a "\"
'
Const UploadPath = "D:\Ftp Upload\"
'*************************************************************************
'**** DO NOT EDIT BELOW **** DO NOT EDIT BELOW **** DO NOT EDIT BELOW ****
'*************************************************************************
'**** DO NOT EDIT BELOW **** DO NOT EDIT BELOW **** DO NOT EDIT BELOW ****
'*************************************************************************
Sub OnClientLoggedIn()
Dim FSO, FolderSize
Set FSO = CreateObject("Scripting.FileSystemObject")
If NOT (FSO.FolderExists(UploadPath & Client.Username)) Then
FSO.CreateFolder(UploadPath & Client.Username)
End If
Set FSO = Nothing
End Sub
Sub OnClientDisconnected()
Dim FSO, FolderSize
Set FSO = CreateObject("Scripting.FileSystemObject")
If (FSO.FolderExists(UploadPath & Client.Username)) Then
FolderSize = FSO.GetFolder(UploadPath & Client.Username).Size
If FolderSize = 0 Then
FSO.DeleteFolder(UploadPath & Client.Username)
End If
End If
Set FSO = Nothing
End Sub