Uploading all of files in my local directory with curl

痴心易碎 提交于 2019-12-17 15:29:10

问题


I want to upload all the files in one directory, and I know how to upload one file using curl like this :

curl -T "local/xxx.suffix" -u xxx:psw "ftp://192.168.1.158/public/demon_test/xxx.suffix"

How can I upload all the files (subdirectory) in the current directory to an FTP server?


回答1:


Use curl with find to recursively upload all files from a specific directory:

find mydir -type f -exec curl -u xxx:psw --ftp-create-dirs -T {} ftp://192.168.1.158/public/demon_test/{} \;



回答2:


instead of curl, use wput (not to be confused with wget).



来源:https://stackoverflow.com/questions/14019890/uploading-all-of-files-in-my-local-directory-with-curl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!