/// <summary> /// Downloads remote file using alternate local filename. /// </summary> /// <param name="localFile">Local filename to use for download.</param> public void Get(string localFile) { string remoteFile = FtpPath.Combine(m_parent.FullPath, Name); FtpFileTransferer transferer = new FtpFileTransferer(m_parent, localFile, remoteFile, Size, TransferDirection.Download); transferer.StartTransfer(); }
/// <summary> /// Downloads remote file using alternate local filename. /// </summary> /// <param name="localFile">Local filename to use for download.</param> public void Get(string localFile) { string remoteFile = $"{m_parent.FullPath}/{Name}"; FtpFileTransferer transferer = new FtpFileTransferer(m_parent, localFile, remoteFile, Size, TransferDirection.Download); transferer.StartTransfer(); }
/// <summary> /// Starts asynchrnonous local file upload to directory using alternate name. /// </summary> /// <param name="localFile">Local file to upload.</param> /// <param name="remoteFile">Remote filename to use for upload.</param> public void BeginPutFile(string localFile, string remoteFile) { CheckSessionCurrentDirectory(); FileInfo fi = new FileInfo(localFile); if ((object)remoteFile == null) { remoteFile = fi.Name; } FtpFileTransferer transfer = new FtpFileTransferer(this, localFile, remoteFile, fi.Length, TransferDirection.Upload); transfer.StartAsyncTransfer(); }
/// <summary> /// Starts asynchronous remote file download from directory using alternate local filename. /// </summary> /// <param name="localFile">Local filename to use for download.</param> /// <param name="remoteFile">Remote filename to download.</param> public void BeginGetFile(string localFile, string remoteFile) { InitHashtable(); FtpFile file; if (m_files.TryGetValue(remoteFile, out file)) { FtpFileTransferer transfer = new FtpFileTransferer(this, localFile, remoteFile, file.Size, TransferDirection.Download); transfer.StartAsyncTransfer(); } else { throw new FtpFileNotFoundException(remoteFile); } }