Zip Files - WeOnlyDo Discussion board

Zip Files (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Dave, Thursday, September 28, 2023, 15:41 (212 days ago) @ Jasmine

Hi.

When you say "i did all the code changes requested", who did request those changes? Your code is more/less ok. You should not use Sleep since you block the thread where wodSFTP lives, tho. However, in your specific changes, since Blocking = True, it does not make a difference since blocking calls (Connect, PutFile) stop your execution until they are complete, and then give control back to you anyway.

Anyway, can you remove all of your code and try simple

sftp1 = new wodSFTPCom
sftp1.Hostname = "something"
sftp1.Login = "something"
sftp1.Password = "something" // change this to key authentication if you use it
sftp1.Blocking = true

sftp1.Connect
sftp1.PutFile ......

Those are only required lines to connect and upload file. Your other app's logic could be moved outside of the function that connects to SFTP server.

If above code fails, can you tell me exact error you're getting?

Regards,
Jasmine

Jasmine

I made all the code adjustments - I already posted on the forum. I was grasping at straws at this point.

I made the changes you suggested and it worked. It's not working consistently. I think at this point it's really the server and not the wodSFTP.dll or my code. I literally made the code the same as you suggested and it worked.

Question: After the PutFile, how do we see if an error came back without declaring the wodSFTPCom with a With Events option?

Dave


Complete thread: