文件名称:FtpLib upload class
文件大小:9KB
文件格式:H
更新时间:2019-09-12 16:14:42
Ftp upload 上传
char usrpasswd[256]; sprintf(usrpasswd, "%s:%s", user, password); FILE *file = fopen(localpath, "rb"); if (file == NULL) { perror(NULL); return FTP_LOCALFILE_NOTACCESS; } CURLcode resCode = FtpUpload(remotepath, usrpasswd,file); if (resCode == CURLE_OK){ return FTP_OK; } else { char errorMsg[1023]; sprintf(errorMsg, "%s/n", curl_easy_strerror(resCode)); if (resCode == CURLE_LOGIN_DENIED){ return FTP_LOGIN_DENIED; } else if (resCode == CURLE_COULDNT_CONNECT){ return FTP_COULDNT_CONNECT; } return FTP_FAIL; }