FtpDLX - LoopItem not changing values (wodSFTP / wodSFTP.NET / wodSFTPdll)
I am using clientside VBScript to FTP from an ASP page. Everything works good, except I need to change the filenames as they are being uploaded, as well as skip anything that is not a JPG file. I thought I found sample code to do this within the LoopItem function, but it isn't working.
[code]
Sub bUpload_OnClick
wodFtpDLX1.Protocol = < =sProtocol >
wodFtpDLX1.Hostname = < =sHostname >
wodFtpDLX1.Login = < =sLogin >
wodFtpDLX1.Password = < =sPassword >
wodFtpDLX1.Port = < =sPort >
wodFtpDLX1.RemotePath = < =sRemotePath >
wodFtpDLX1.Blocking = true
wodFtpDLX1.Passive = false
wodFtpDLX1.Connect
wodFtpDLX1.PutFiles sLocalpath.value, < =sRemoteDir >
wodFtpDLX1.Disconnect
sUploadedFiles.value = sUploadedFiles.value & iFileCount & Files Uploaded
End Sub
Sub wodFtpDLX1_LoopItem(LocalFile, RemoteFile, ItemType, Skip)
If ucase(Right(RemoteFile, 4)) = ucase( .jpg ) Then
sPath = Right(RemoteFile, len(RemoteFile) - inStrRev(RemoteFile, / ))
RemoteFile = < =sRemoteDir >< =iClientID >_< =iProgramID >_ & iEventID.value & _ & sPath
sUploadedFiles.value = sUploadedFiles.value & Uploading: & RemoteFile & VbCrLf & VbCrLf
iFileCount = iFileCount+1
Skip = False
Else
Skip = True
End If
End Sub
[/code]
iFileCount correctly displays only the number of JPGs (so getting in the If/Else) but all files are uploaded - regardless of me setting Skip = True if not a JPG.
Also, the new value of RemoteFile displays correctly in the textarea (sUploadedFiles) but when the file is actually FTP'd, it come sover as its old name (the one on the local machine, not the one defined in LoopItem).
I tried to switch it to non-blocking and listen for events instead but it kept hanging, so I went back to this blocking version.
What am I missing?
Jenn