File upload support for webternet (r=psychonic).

This commit is contained in:
Asher Baker
2013-05-16 14:49:03 +01:00
parent 22d11160ba
commit 25fced78e8
3 changed files with 25 additions and 1 deletions
+12
View File
@@ -18,6 +18,18 @@ bool WebForm::AddString(const char *name, const char *data)
return lastError == CURL_FORMADD_OK;
}
bool WebForm::AddFile(const char *name, const char *path)
{
lastError = curl_formadd(&first,
&last,
CURLFORM_COPYNAME,
name,
CURLFORM_FILE,
path,
CURLFORM_END);
return lastError == CURL_FORMADD_OK;
}
curl_httppost *WebForm::GetFormData()
{
return first;
+1
View File
@@ -44,6 +44,7 @@ public:
~WebForm();
public:
bool AddString(const char *name, const char *data);
bool AddFile(const char *name, const char *path);
public:
curl_httppost *GetFormData();
private: