时间:2021-07-01 10:21:17 帮助过:12人阅读
code = curl_easy_setopt(ftp_handle, CURLOPT_URL, "ftp:127.0.0.1:990/");code = curl_easy_setopt(ftp_handle, CURLOPT_USERNAME, "username");code = curl_easy_setopt(ftp_handle, CURLOPT_PASSWORD, "password");code = curl_easy_setopt(ftp_handle, CURLOPT_DIRLISTONLY, 1L); /*code = curl_easy_setopt(ftp_handle, CURLOPT_FTP_SSL_CCC, CURLFTPSSL_CCC_NONE);code = curl_easy_setopt(ftp_handle, CURLOPT_SSL_VERIFYPEER, 1L);code = curl_easy_setopt(ftp_handle, CURLOPT_SSL_VERIFYHOST, 2L);code = curl_easy_setopt(ftp_handle, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS);code = curl_easy_setopt(ftp_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);*/ /*code = curl_easy_setopt(ftp_handle, CURLOPT_TLSAUTH_TYPE, 1L);code = curl_easy_setopt(ftp_handle, CURLOPT_TLSAUTH_USERNAME, "tms");code = curl_easy_setopt(ftp_handle, CURLOPT_TLSAUTH_PASSWORD, "ewstms");*/ /*code = curl_easy_setopt(ftp_handle, CURLOPT_USE_SSL, CURLUSESSL_ALL);*/ code = curl_easy_setopt(ftp_handle, CURLOPT_VERBOSE, 1L);CURLcode res = curl_easy_perform(ftp_handle);
http://cgwxyz.blog.163.com/blog/static/2628060201202953249575/
http://www.web-development-blog.com/archives/tutorial-ftp-upload-via-curl/
http://bbs.csdn.net/topics/350170833
http://bbs.csdn.net/topics/350170833
谢谢
但你给的这些,都不带SSL认证的
如果FTP服务器强制要求SSL认证登陆,这些就都不行了吧
换成:
curl_easy_setopt(ftp_handle, CURLOPT_URL, "ftps://192.168.1.63");