public static void Upload(Stream localFile, string remoteFile) { try { ftp = new FTP(Host, User, Pass); ftp.CreateDirectoryByRemoteFile(remoteFile); ftp.Upload(localFile, remoteFile); } catch (Exception ex) { throw new Exception(ex.Message); } }