|
Познающий
Регистрация: 27.08.2009
Сообщений: 82
Провел на форуме: 131097
Репутация:
5
|
|
еще такой вопрос, делаю отправку картинки, посмотрел что в браузере отправляется постом:
-----------------------------169443243924626
Content-Disposition: form-data; name="act"
add
-----------------------------169443243924626
Content-Disposition: form-data; name="from"
file
-----------------------------169443243924626
Content-Disposition: form-data; name="new_photo"; filename="000001103_s.jpeg"
Content-Type: image/jpeg
...........тут код картинки на китайском)))............
я делаю отправку курлом так:
struct curl_httppost* Post = NULL;
struct curl_httppost* last = NULL
curl_formadd(&Post, &last, CURLFORM_COPYNAME, "new_photo", CURLFORM_FILE, image.c_str(), CURLFORM_CONTENTTYPE, "image/jpeg", CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, Post);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_HEADER, header);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, followFlag);
curl_easy_setopt(curl, CURLOPT_REFERER, referer.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "c:/cookie.txt");
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "c:/cookie.txt");
curl_easy_perform(curl);
но ничего не выходит, что я делаю не так???))
Последний раз редактировалось eldar85; 18.04.2010 в 11:44..
|