clibcurl文件上傳
『壹』 libcurl.dll怎麼恢復
先從網站下載下來libcurl.dll文件之後,先將其解壓(一般都是rar壓縮包), 然後根據您系統的情況選擇X86/X64,X86為32位電腦,X64為64位電腦。默認都是支持32位系統的。
使用方法:
1.直接拷貝該文件到系統目錄里:
1)Windows 95/98/Me系統,將此文件復制到c:\Windows\System目錄下。
2)Windows NT/2000系統,將此文件復制到c:\WINNT\System32目錄下。
3)Windows XP/WIN7系統,將此文件復制到c:\Windows\System32目錄。
4)如果您的系統是64位的請將文件復制到C:\WindowsSys\WOW64目錄
2.然後打開"開始-運行-輸入regsvr32 libcurl.dll",回車即可解決錯誤提示!
你可以使用庫函數啊,
比如libftp或者libcurl(記得支持的)。
具體的用法你可以查閱相關的說明文檔。比你自己寫一個客戶端簡單多了。
再看看別人怎麼說的。
『叄』 關於libcurl庫如何在ftp上創建文件和文件夾
在你的curl_easy_perform函數執行之前加上這一句curl_easy_setopt(yourhandle,
CURLOPT_FTP_CREATE_MISSING_DIRS,
1);
達到的效果是遠程伺服器如果沒有這個目錄,會自動創建然後上傳文件到這個目錄下面。你問的那個問題應該跟這個有些類似,建議你多看看
頭文件
的定義和文檔。
『肆』 基於libcurl庫,用C++編寫了FTP上傳函數,傳本地文件,現在為了提高效率,想直接發一段內存過去,咋做
寫一個回調函數,將文件切分成多塊,每次上傳成功就增加 size 記錄當前已經下載的大小 記得讀寫文件要用 fseek
『伍』 libcurl.dll怎麼安裝
樓主你好,你可以重新下載一個libcurl.dll文件文件,然後按如下步驟操作:
一、解壓後直接拷貝該文件到系統目錄里:
1、Windows 95/98/Me系統,復制到C:WindowsSystem目錄下。
2、Windows NT/2000系統,復制到C:WINNTSystem32目錄下。
3、Windows XP/WIN7/Vista系統,復制到C:WindowsSystem32目錄下。
4、如果您的系統是64位的請將文件復制到C:WindowsSysWOW64目錄
二、打開"開始-運行-輸入regsvr32 libcurl.dll文件",回車即可解決。
已上傳並提供下載連接,可根據需要下載。
libcurl.dll文件下載地址:http://www.edowning.net/soft/68096.htm
『陸』 電腦開機後出現丟失libcurl.dll怎麼辦
樓主你好,你可以重新下載一個libcurl.dll文件,復制到c:\windows\system32文件夾,然後「開始,運行,輸入regsvr32
libcurl.dll」即可。已上傳並提供下載連接,可根據需要下載。
libcurl.dll文件下載地址:http://www.edowning.net/soft/68096.htm
『柒』 c++多線程中使用libcurl庫的問題
庫本身是線程安全的,多個線程之間不要共享CURL*的句柄,應該是沒有問題的. 以下是官方說法:
http://curl.haxx.se/libcurl/c/libcurl-tutorial.html 中的Multi-threading Issues:
The first basic rule is that you must never
simultaneously share a libcurl handle (be it easy or multi or whatever)
between multiple threads. Only use one handle in one thread at any
time. You can pass the handles around among threads, but you must never
use a single handle from more than one thread at any given time.
libcurl is completely thread safe, except for two
issues: signals and SSL/TLS handlers. Signals are used for timing out
name resolves (ring DNS lookup) - when built without c-ares support
and not on Windows.
If you are accessing HTTPS or FTPS URLs in a
multi-threaded manner, you are then of course using the underlying SSL
library multi-threaded and those libs might have their own requirements
on this issue. Basically, you need to provide one or two functions to
allow it to function properly.
『捌』 嵌入式linux能不能用ftp協議上傳文件到伺服器
當然可以啊,移植個ftp庫,調用ftp庫上傳文件。ftp庫很多,調用api就好了,根本不需要命令,libcurl就是一個支持ftp的庫。
『玖』 C++用libcurl庫GET網頁(比如baidu.com)並將獲取到的網頁內容保存到本地文件夾中
#include <io.h>
#include "curl/curl.h"
#pragma comment(lib, "ws2_32.lib")
#pragma comment ( lib, "libcurl.lib" )
#pragma comment ( lib, "ws2_32.lib" )
#pragma comment ( lib, "winmm.lib" )
#pragma comment ( lib, "wldap32.lib" )
//這是libcurl接收數據的回調函數,相當於recv的死循環
//其中stream可以自定義數據類型,這里我傳入的是文件保存路徑
static size_t write_callback( void *ptr, size_t size, size_t nmemb, void *stream )
{
int len = size * nmemb;
int written = len;
FILE *fp = NULL;
if ( access( (char*)stream, 0 ) == -1 )
{
fp = fopen( (char*) stream, "wb" );
}
else
{
fp = fopen( (char*) stream, "ab" );
}
if (fp)
{
fwrite( ptr, size, nmemb, fp );
}
return written;
}
int GetUrl( const char *url, char *savepath )
{
CURL *curl;
CURLcode res;
struct curl_slist *chunk = NULL;
curl = curl_easy_init();
if ( curl ) {
curl_easy_setopt( curl, CURLOPT_VERBOSE, 0L );
curl_easy_setopt( curl, CURLOPT_URL, url );
//指定回調函數
curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, write_callback);
//這個變數可作為接收或傳遞數據的作用
curl_easy_setopt( curl, CURLOPT_WRITEDATA, savepath );
res = curl_easy_perform( curl );
if (res == CURLE_OK)
{
return 1;
}
return 0;
}
}
int main( void )
{
if ( GetUrl( "t.sina.com.cn", "c:/1.txt" ) )
{
printf( "OK" );
}
return 0;
}