gpt4 book ai didi

windows - 无法通过 psftp 使用通配符上传所有文件

转载 作者:行者123 更新时间:2023-12-03 11:06:20 26 4
gpt4 key购买 nike

我想上传C:\Users\myuser\Downloads\SFTP中的所有文件我本地 Windows 上的文件夹到远程 SFTP 服务器 myfolder目录。

我在 Windows 上运行 sftp 并实现上述目标时遇到多个问题。

下面是我的命令:

C:\putty\psftp.exe -b C:\putty\sftp_commands.txt -l myuser -pw mypass 10.8.44.86

这是我的 C:\putty\sftp_commands.txt文件:
mkdir myfolder
cd myfolder
lcd "C:\Users\myuser\Downloads\SFTP"
put "C:\Users\myuser\Downloads\SFTP\*.*"

尽管我的本地 Windows 上存在该文件,但我仍收到“无法打开”错误。

这在我更改时有效 C:\Users\myuser\Downloads\SFTP\*.*C:\Users\myuser\Downloads\SFTP\file1.txt .
C:\Users\myuser\Desktop>C:\putty\psftp.exe -b C:\putty\sftp_commands.txt -l myuser -pw mypass 10.8.44.86
Using username "myuser".
Pre-authentication banner message from server:
| EFT Server Enterprise 7.3.2.8
End of banner message from server
Keyboard-interactive authentication prompts from server:
End of keyboard-interactive prompts from server
Remote working directory is /
mkdir /myfolder: OK
Remote directory is now /myfolder
New local directory is C:\Users\myuser\Downloads\SFTP
local: unable to open C:\Users\myuser\Downloads\SFTP\*.*

你能建议我的代码有什么问题吗?

最佳答案

put不支持通配符,必须使用 mput :

lcd "C:\Users\myuser\Downloads\SFTP"
mput *.*

关于windows - 无法通过 psftp 使用通配符上传所有文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59424579/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com