Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public void FTPZippedFile(some params....)
{
//create and set variables
var fallback = Policy
.Handle<SessionRemoteException>()
.Fallback((ex)=> SendEmail(ex.Message));
var fileUploadResult = fallback.Execute(() =>
UploadFile(zipFileName, fullzipFilepath,
transOptions, sessionOptions));
// do soemthing with result
}
public string UploadFile(string zipFileName, string fullZipFilePath,
TransferOptions transOptions, SessionOptions sessionOptions)
{
using (var session = new Session())
{
session.Open(sessionOptions);
return session.PutFiles(
zipFileName,
fullZipFilePath,
false,
transOptions);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.