青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Error

C++博客 首頁 新隨筆 聯系 聚合 管理
  217 Posts :: 61 Stories :: 32 Comments :: 0 Trackbacks

官方文檔:

FTP Custom Commands

Not all protocols are HTTP-like, and thus the above may not help you when you want to make, for example, your FTP transfers to behave differently.

Sending custom commands to a FTP server means that you need to send the commands exactly as the FTP server expects them (RFC 959 is a good guide here), and you can only use commands that work on the control-connection alone. All kinds of commands that require data interchange and thus need a data-connection must be left to libcurl's own judgement. Also be aware that libcurl will do its very best to change directory to the target directory before doing any transfer, so if you change directory (with CWD or similar) you might confuse libcurl and then it might not attempt to transfer the file in the correct remote directory.

A little example that deletes a given file before an operation:

headers = curl_slist_append(headers, "DELE file-to-remove");

/* pass the list of custom commands to the handle */  curl_easy_setopt(easyhandle, CURLOPT_QUOTE, headers);

curl_easy_perform(easyhandle); /* transfer ftp data! */

curl_slist_free_all(headers); /* free the header list */

If you would instead want this operation (or chain of operations) to happen _after_ the data transfer took place the option to curl_easy_setopt(3) would instead be called CURLOPT_POSTQUOTE and used the exact same way.

The custom FTP command will be issued to the server in the same order they are added to the list, and if a command gets an error code returned back from the server, no more commands will be issued and libcurl will bail out with an error code (CURLE_QUOTE_ERROR). Note that if you use CURLOPT_QUOTE to send commands before a transfer, no transfer will actually take place when a quote command has failed.

If you set the CURLOPT_HEADER to 1, you will tell libcurl to get information about the target file and output "headers" about it. The headers will be in "HTTP-style", looking like they do in HTTP.

The option to enable headers or to run custom FTP commands may be useful to combine with CURLOPT_NOBODY. If this option is set, no actual file content transfer will be performed.

FTP Custom CUSTOMREQUEST

If you do want to list the contents of a FTP directory using your own defined FTP command, CURLOPT_CUSTOMREQUEST will do just that. "NLST" is the default one for listing directories but you're free to pass in your idea of a good alternative.

 

中文:

FTP自定義命令

并不是所以的協議都像HTTP那樣,通過消息頭來告訴服務器如何處理請求。對于FTP,你就要使用另外的方式來處理。

發送自定義的命令到ftp服務器,意味著你發送的命令必須是能被ftp服務器理解的命令(FTP協議中定義的命令,參考rfc959)。

下面是一個簡單的例子,在文件傳輸操作操作之前刪除指定文件:

headers = curl_slist_append(headers, "DELE file-to-remove"); /* pass the list of custom commands to the handle */ curl_easy_setopt(easyhandle, CURLOPT_QUOTE, headers); //curl_easy_setopt(easyhandle, CURLOPT_POSTQUOTE, headers); // 在數據傳輸之后操行刪除操作
curl_easy_perform(easyhandle); /* transfer ftp data! */ curl_slist_free_all(headers); /* free the header list */

FTP服務器執行命令的順序,同這些命令被添加到列表中順序是一致的。發往服務器的命令列表中,只要有一個命令執行失敗,ftp服務器就會返回一個錯誤代碼,此時libcurl將直接返回CURLE_QUOTE_ERROR,不再執行剩余的FTP命令。

將CURLOPT_HEADER設置為1,libcurl獲取目標文件的信息,并以HTTP消息頭的樣式來輸出消息頭。

FTP自定義CUSTOMREQUEST

使用CURLOPT_CUSTOMREQUEST屬性,可以向FTP服務器發送命令。”NLST”是ftp默認的列出文件列表的命令。 下面的代碼用于列出FTP服務器上的文件列表:

int main(int argc, char **argv) { curl_global_init(CURL_GLOBAL_WIN32); CURL *easy_handle = curl_easy_init(); curl_easy_setopt(easy_handle, CURLOPT_URL, "ftp://127.0.0.1/");curl_easy_setopt(easy_handle, CURLOPT_CUSTOMREQUEST, "NLST");
curl_easy_perform(easy_handle); curl_easy_cleanup(easy_handle); curl_global_cleanup(); return 0; }
posted on 2012-06-29 00:14 Enic 閱讀(613) 評論(0)  編輯 收藏 引用

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久精品亚洲一区二区三区浴池| 亚洲毛片在线观看| 99国产精品久久久久久久久久 | 亚洲激情影视| 欧美一区二区三区视频免费| 亚洲片在线资源| 嫩草影视亚洲| 一区二区三区精品久久久| 亚洲精品中文字幕在线| 亚洲综合日韩在线| 欧美刺激午夜性久久久久久久| 精东粉嫩av免费一区二区三区| 亚洲午夜精品久久| 亚洲伦理自拍| 最新亚洲视频| 欧美日韩一级黄| 亚洲愉拍自拍另类高清精品| 亚洲一区二区三区国产| 一区二区三区四区五区精品视频| 欧美福利视频| 免费在线成人av| 一本色道久久| 亚洲一区二区三区777| 一本色道久久综合亚洲精品小说| 欧美性猛交xxxx乱大交蜜桃| 亚洲欧美在线aaa| 亚洲午夜在线观看| 亚洲私拍自拍| 国产一区二区按摩在线观看| 欧美成年网站| 亚洲福利在线看| 欧美另类一区| 国产精品毛片在线| 国产麻豆9l精品三级站| 久久蜜桃精品| 欧美精品一区在线播放| 亚洲欧美日韩中文播放| 久久国产黑丝| 欧美成人官网二区| 亚洲综合精品一区二区| 欧美在线视频一区| 99在线|亚洲一区二区| 亚洲尤物在线| 国产精品嫩草99av在线| 另类尿喷潮videofree | 欧美成人高清视频| 亚洲小视频在线观看| 久久精品国产2020观看福利| 99精品99| 欧美影院午夜播放| 免费在线看一区| 欧美一区二区成人| 欧美伦理视频网站| 久久九九精品99国产精品| 欧美精品日韩www.p站| 亚洲成人自拍视频| 亚洲无限乱码一二三四麻| 1024亚洲| 亚洲午夜久久久久久尤物| 亚洲激情精品| 久久国产精品一区二区三区| 一区二区欧美在线| 免费国产自线拍一欧美视频| 久久精品在线播放| 国产精品大片| 日韩视频免费| 免费精品视频| 亚洲欧美激情精品一区二区| 欧美gay视频激情| 免费观看30秒视频久久| 国产人成精品一区二区三| 亚洲精品资源| 日韩午夜精品| 欧美韩国日本综合| 欧美成人午夜剧场免费观看| 欧美视频二区36p| 最新日韩av| 亚洲精品久久7777| 老司机67194精品线观看| 久久精品国产亚洲精品| 亚洲区国产区| 亚洲片在线观看| 老司机成人网| 欧美高清在线一区二区| 在线欧美小视频| 久久嫩草精品久久久精品一| 久久伊伊香蕉| 极品av少妇一区二区| 久久精品成人| 欧美+亚洲+精品+三区| 亚洲二区在线观看| 欧美88av| 亚洲欧洲精品一区二区三区不卡 | 免费视频久久| 亚洲国产毛片完整版| 欧美大尺度在线观看| 亚洲高清在线| 亚洲乱码久久| 欧美日韩一区二区视频在线| 亚洲天堂成人在线视频| 久久精品综合| 亚洲激情视频在线| 欧美日韩国产区一| 亚洲一区在线免费| 久久一区二区三区超碰国产精品| 精品9999| 欧美吻胸吃奶大尺度电影| 亚洲一区二区综合| 免费成人av资源网| 黄色成人在线观看| 美女图片一区二区| 日韩一本二本av| 欧美一区网站| 亚洲高清一区二区三区| 欧美国产一区视频在线观看| 亚洲国产国产亚洲一二三| 亚洲一区二区三区免费观看| 国产一区二区高清视频| 欧美成人精品h版在线观看| 一区二区三区 在线观看视频| 欧美夜福利tv在线| 亚洲激情一区二区三区| 国产精品久久久久一区二区三区| 久久久久欧美精品| 一本色道久久88综合日韩精品 | 欧美国产日本在线| 亚洲一区二区av电影| 欧美激情第五页| 欧美一区二区三区久久精品茉莉花| 亚洲国产精品久久| 国产欧美三级| 欧美色图麻豆| 美女黄色成人网| 亚洲欧美日韩高清| 99在线|亚洲一区二区| 欧美成人高清视频| 久久精品一区二区三区四区| 一区二区三区av| 亚洲大片在线观看| 国产视频亚洲| 国产精品男人爽免费视频1| 蜜臀av一级做a爰片久久| 香蕉成人久久| 中国av一区| 日韩视频精品在线观看| 欧美国产精品一区| 久久久久欧美精品| 欧美一区二区视频在线观看| 亚洲午夜激情网站| 一区二区三区视频在线看 | 99精品热视频| 亚洲国产精品小视频| 免费欧美网站| 久久精品1区| 久久成人免费电影| 欧美亚洲视频在线观看| 亚洲一区二区3| 亚洲一区二区三区四区中文| 99精品国产高清一区二区 | 久久激情婷婷| 性做久久久久久久久| 亚洲精品精选| 国产一区二区三区四区| 欧美日韩国产欧| 欧美日韩一区二区三区在线| 欧美日韩小视频| 国产精品福利片| 国产精品美女久久福利网站| 国产精品国产a| 国产欧美va欧美va香蕉在| 国产精品永久免费观看| 国产一区二区高清视频| 国产在线日韩| 亚洲电影专区| 99国产精品99久久久久久| 99综合在线| 先锋影音网一区二区| 久久精品99国产精品| 久久男女视频| 亚洲丰满在线| 一本到12不卡视频在线dvd| 欧美一区二区三区四区在线| 欧美va天堂| 国产手机视频一区二区| 亚洲蜜桃精久久久久久久| 久久黄色网页| 一区二区激情小说| 久久亚洲精品欧美| 国产精品你懂的在线欣赏| 亚洲经典自拍| 久久高清国产| 一卡二卡3卡四卡高清精品视频| 欧美怡红院视频| 国产精品99免视看9| 亚洲区欧美区| 乱人伦精品视频在线观看| 亚洲视频免费在线观看| 欧美福利电影在线观看| 国产综合网站| 久久超碰97中文字幕|