mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
FTP: transfer type set to binary
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
Released on FIXME:
|
Released on FIXME:
|
||||||
|
|
||||||
- Bugfix:
|
- Bugfix:
|
||||||
|
- [Issue 18](https://github.com/veeso/termscp/issues/18): Set file transfer type to `Binary` for FTP
|
||||||
- [Issue 10](https://github.com/veeso/termscp/issues/10): Fixed port not being loaded from bookmarks into gui
|
- [Issue 10](https://github.com/veeso/termscp/issues/10): Fixed port not being loaded from bookmarks into gui
|
||||||
- [Issue 9](https://github.com/veeso/termscp/issues/9): Fixed issues related to paths on remote when using Windows
|
- [Issue 9](https://github.com/veeso/termscp/issues/9): Fixed issues related to paths on remote when using Windows
|
||||||
- Dependencies:
|
- Dependencies:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ use crate::utils::parser::{parse_datetime, parse_lstime};
|
|||||||
|
|
||||||
// Includes
|
// Includes
|
||||||
use ftp4::native_tls::TlsConnector;
|
use ftp4::native_tls::TlsConnector;
|
||||||
use ftp4::FtpStream;
|
use ftp4::{types::FileType, FtpStream};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
@@ -370,7 +370,14 @@ impl FileTransfer for FtpFileTransfer {
|
|||||||
if let Err(err) = stream.login(username.as_str(), password.as_str()) {
|
if let Err(err) = stream.login(username.as_str(), password.as_str()) {
|
||||||
return Err(FileTransferError::new_ex(
|
return Err(FileTransferError::new_ex(
|
||||||
FileTransferErrorType::AuthenticationFailed,
|
FileTransferErrorType::AuthenticationFailed,
|
||||||
format!("{}", err),
|
err.to_string(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
// Initialize file type
|
||||||
|
if let Err(err) = stream.transfer_type(FileType::Binary) {
|
||||||
|
return Err(FileTransferError::new_ex(
|
||||||
|
FileTransferErrorType::ProtocolError,
|
||||||
|
err.to_string(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
// Set stream
|
// Set stream
|
||||||
|
|||||||
Reference in New Issue
Block a user