Upload Fails
I am trying to upload a file to a website and keep getting the error:
Error transferring file 'c:\working\access\temp\testWayne.txt'.
Copying files to remote side failed.
Could not create file.
Theile exist. I don't unserstand why it wont upload. I uploads manually, just not with this script.
********** code below ************
Dim Sess As WinSCPnet.Session, SessOpts As SessionOptions, RDI As RemoteDirectoryInfo, TransOpts As TransferOptions, TransRslt As TransferOperationResult, Transac As TransferEventArgs
On Error GoTo ErrorHandler
Set Sess = New Session
Set SessOpts = New SessionOptions
Set TransOpts = New TransferOptions
With SessOpts
.protocol = Protocol_Ftp
.hostname = "websiteeee.com"
.UserName = "loginnnnn"
.Password = "pwddddd"
End With
Sess.Open SessOpts
TransOpts.TransferMode = TransferMode_Binary
Set TransRslt = Sess.PutFiles("c:\working\access\temp\testWayne.txt", "/Wayne", True, TransOpts)
TransRslt.Check 'Trigger error if any
For Each Transac In TransRslt.Transfers
Debug.Print Transac.FileName
Next
Error transferring file 'c:\working\access\temp\testWayne.txt'.
Copying files to remote side failed.
Could not create file.
Theile exist. I don't unserstand why it wont upload. I uploads manually, just not with this script.
********** code below ************
Dim Sess As WinSCPnet.Session, SessOpts As SessionOptions, RDI As RemoteDirectoryInfo, TransOpts As TransferOptions, TransRslt As TransferOperationResult, Transac As TransferEventArgs
On Error GoTo ErrorHandler
Set Sess = New Session
Set SessOpts = New SessionOptions
Set TransOpts = New TransferOptions
With SessOpts
.protocol = Protocol_Ftp
.hostname = "websiteeee.com"
.UserName = "loginnnnn"
.Password = "pwddddd"
End With
Sess.Open SessOpts
TransOpts.TransferMode = TransferMode_Binary
Set TransRslt = Sess.PutFiles("c:\working\access\temp\testWayne.txt", "/Wayne", True, TransOpts)
TransRslt.Check 'Trigger error if any
For Each Transac In TransRslt.Transfers
Debug.Print Transac.FileName
Next