File upload support for webternet (r=psychonic).
This commit is contained in:
@@ -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,
|
||||
data,
|
||||
CURLFORM_END);
|
||||
return lastError == CURL_FORMADD_OK;
|
||||
}
|
||||
|
||||
curl_httppost *WebForm::GetFormData()
|
||||
{
|
||||
return first;
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user