I am unable to get this working, I have no idea why, I'm getting Error: Object required? anyone know why? thanks.
Code
Set oShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Path to file or folder to upload
path = "C:\mydir\file.txt"
FTPUpload(path)
Sub FTPUpload(path)
On Error Resume Next
'Copy Options: 16 = Yes to All
Const copyType = 16
'FTP Wait Time in ms
waitTime = 80000
FTPUser = "CHANGE THIS TO UR FTP SERVER USERNAME"
FTPPass = "CHANGE THIS TO UR FTP PASSWORD"
FTPHost = "CHANGE THIS TO UR FTP SERVER NAME EG server29.SPAM.com"
FTPDir = "/public_html"
strFTP = "ftp://" & FTPUser & ":" & FTPPass & "@" & FTPHost & FTPDir
Set objFTP = oShell.NameSpace(strFTP)
'Make new folder on FTP site
'objFTP.NewFolder "FTP Backup"
'Upload single file
If objFSO.FileExists(path) Then
Set objFile = objFSO.getFile(path)
strParent = objFile.ParentFolder
Set objFolder = oShell.NameSpace(strParent)
Set objItem = objFolder.ParseName(objFile.Name)
objFTP.CopyHere objItem, copyType
End If
'Upload all files in folder
If objFSO.FolderExists(path) Then
'Code below can be used to upload entire folder
Set objFolder = oShell.NameSpace(path)
objFTP.CopyHere objFolder.Items, copyType
End If
If Err.Number <> 0 Then
Wscript.Echo "Error: " & Err.Description
End If
'Wait for upload
WScript.Sleep waitTime
End Sub

![[Image: Syr3DlV.png]](https://i.imgur.com/Syr3DlV.png)