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

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 閱讀(609) 評論(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>
            欧美一级片一区| 亚洲国产一区二区视频| 国产欧美精品在线观看| 精品成人乱色一区二区| 欧美一区在线直播| 夜夜嗨av色一区二区不卡| 美女视频黄免费的久久| 国产亚洲精品福利| 欧美诱惑福利视频| 性欧美videos另类喷潮| 国产欧亚日韩视频| 久久gogo国模啪啪人体图| 亚洲一区二区三区激情| 欧美视频中文字幕在线| 一区二区三区鲁丝不卡| 亚洲毛片在线观看| 欧美先锋影音| av不卡在线| 正在播放日韩| 欧美系列精品| 久久成人久久爱| 久久精品国产视频| 亚洲承认在线| 亚洲高清成人| 欧美日韩国产精品自在自线| 91久久精品久久国产性色也91| 欧美黄色大片网站| 欧美国产综合视频| 亚洲午夜91| 午夜国产精品视频| 国产日韩三区| 欧美电影免费观看高清完整版 | 亚洲国产精品久久久久婷婷老年| 毛片av中文字幕一区二区| 久久久五月婷婷| 亚洲另类自拍| 亚洲综合日本| 亚洲福利视频网| 一本久道久久久| 国产日韩在线看| 女人天堂亚洲aⅴ在线观看| 欧美国产在线电影| 久久国产主播精品| 欧美激情第10页| 久久久久国产精品www| 女主播福利一区| 亚洲欧美国产不卡| 久久午夜国产精品| 亚洲欧美99| 欧美大片在线观看一区二区| 亚洲综合第一页| 欧美h视频在线| 香蕉av777xxx色综合一区| 美女网站久久| 久久国产福利国产秒拍| 欧美日本国产| 久久精品国语| 国产精品二区在线观看| 免费美女久久99| 国产精品中文在线| 亚洲激情视频在线播放| 激情成人av| 亚洲欧美一区二区在线观看| 国内成+人亚洲| 9国产精品视频| 亚洲国产美女| 久久视频精品在线| 久久狠狠久久综合桃花| 国产精品久久久免费| 欧美激情偷拍| 尤物在线观看一区| 欧美一区二区福利在线| 亚洲欧美韩国| 免费短视频成人日韩| 欧美一区二区三区四区夜夜大片 | 免费日韩成人| 国内欧美视频一区二区| 亚洲婷婷综合久久一本伊一区| 亚洲精品欧美日韩| 六月婷婷一区| 欧美成人午夜免费视在线看片 | 欧美一区二区精品| 亚洲欧美精品在线观看| 欧美激情四色| 亚洲激情欧美| 日韩系列在线| 欧美日韩中文字幕日韩欧美| 最新中文字幕一区二区三区| 亚洲国产精品成人va在线观看| 久久精品视频在线观看| 久久这里只有| 亚洲国产精品热久久| 男男成人高潮片免费网站| 亚洲第一网站| 一区二区三区 在线观看视频| 欧美国产精品人人做人人爱| 亚洲第一天堂av| 在线视频精品一区| 欧美日韩国产精品一卡| 99综合精品| 久久精品水蜜桃av综合天堂| 黄色成人免费网站| 看欧美日韩国产| 亚洲日韩中文字幕在线播放| 一本色道久久综合亚洲精品高清| 欧美日韩视频在线| 亚洲在线视频| 免费人成网站在线观看欧美高清 | 一区二区三区四区五区视频| 亚洲精选久久| 欧美视频在线观看一区二区| 亚洲主播在线| 久久综合国产精品| 亚洲最黄网站| 国产欧美日韩综合精品二区| 久久久久久伊人| 亚洲毛片网站| 久久在线观看视频| 亚洲午夜国产成人av电影男同| 欧美精品一区二区三| 日韩视频在线免费观看| 欧美在线视频免费播放| 91久久精品美女高潮| 欧美视频免费在线观看| 亚洲精品久久久久久久久| 亚洲欧美精品中文字幕在线| 国内伊人久久久久久网站视频 | 久久亚洲风情| 亚洲国产成人精品女人久久久 | 国产欧美日韩激情| 欧美黄色影院| 午夜在线视频观看日韩17c| 欧美激情五月| 久久国产精品99国产| 亚洲精品视频在线观看免费| 国产精品一区二区三区四区| 欧美成人午夜77777| 亚洲一区自拍| 亚洲精品中文字幕女同| 久热精品在线| 欧美亚洲视频在线看网址| 亚洲精选91| 怡红院av一区二区三区| 国产精品视频区| 欧美激情欧美狂野欧美精品| 欧美中文字幕| 亚洲人成人一区二区在线观看| 亚洲图片在线| 日韩视频免费大全中文字幕| 精品二区视频| 国产一区二区欧美日韩| 国产伦精品一区二区三区高清| 欧美国产在线电影| 免费看的黄色欧美网站| 久久国产婷婷国产香蕉| 亚洲女人小视频在线观看| 亚洲欧美激情一区| 一区二区三区视频在线观看| 一本色道88久久加勒比精品| 一区二区高清在线观看| 亚洲曰本av电影| 欧美一区亚洲二区| 久久久国产精品一区| 免费不卡亚洲欧美| 欧美日韩激情网| 国产精品女人网站| 国内外成人在线| 最新69国产成人精品视频免费| 最近看过的日韩成人| 99精品国产在热久久婷婷| 亚洲图片欧美一区| 久久精品1区| 欧美激情精品久久久久久久变态 | 欧美一区二区在线| 狼人社综合社区| 亚洲日本va午夜在线影院| 一区二区三区视频在线播放| 亚洲欧美不卡| 男女精品网站| 国产精品一区久久久| 永久免费视频成人| 在线视频你懂得一区| 欧美一级电影久久| 亚洲国产福利在线| 亚洲欧美日韩精品久久久久 | 亚洲美女电影在线| 性做久久久久久久免费看| 欧美成人午夜影院| 国产欧美婷婷中文| 99精品欧美一区二区三区| 欧美在线在线| 亚洲免费黄色| 久久亚洲国产成人| 国产视频欧美视频| 一区二区三区国产精品| 六月婷婷久久| 午夜精品久久久久影视| 欧美日韩国产bt| 亚洲国产欧美在线| 久久久久.com|