Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: Upload Fails

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

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 = ""
.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