Only keep filename for cli filename hint

This commit is contained in:
Edward Shen 2022-01-16 19:40:57 -08:00
parent f1ad421777
commit d6b2d53249
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -151,8 +151,12 @@ fn handle_upload(
} }
if !no_file_name_hint { if !no_file_name_hint {
if let Some(path) = path { let file_name = path.and_then(|path| {
fragment = fragment.file_name(path.to_string_lossy().to_string()); path.file_name()
.map(|str| str.to_string_lossy().to_string())
});
if let Some(file_name) = file_name {
fragment = fragment.file_name(file_name);
} }
} }