neocities.h

a C library for interacting with Neocities' API
git clone https://github.com/tanguyandreani/neocities.h
Log | Files | Refs | README | LICENSE

commit 893a39d881136157082c7faa673baea3000b2403
parent 7f44838ff697d22e0ea9baf0c6c6e9644a4ba4f6
Author: Tanguy Andreani <dev@tanguy.space>
Date:   Fri,  1 Mar 2019 04:35:27 +0100

fixed file upload

Diffstat:
Mneocities.h | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/neocities.h b/neocities.h @@ -259,13 +259,15 @@ enum neocities_low_level_error neocities_api(const char *apikey, if (field == NULL) return NEOCITIES_LLVL_ERR_CURL_MIME_ADDPART; - if (curl_mime_name(field, "sendfile") != CURLE_OK) + if (curl_mime_name(field, params) != CURLE_OK) return NEOCITIES_LLVL_ERR_CURL_MIME_NAME; if (curl_mime_filedata(field, params) != CURLE_OK) return NEOCITIES_LLVL_ERR_CURL_MIME_FILEDATA; - field = curl_mime_addpart(form); + /* seems useless :( */ + + /*field = curl_mime_addpart(form); if (field == NULL) return NEOCITIES_LLVL_ERR_CURL_MIME_ADDPART; @@ -274,9 +276,7 @@ enum neocities_low_level_error neocities_api(const char *apikey, return NEOCITIES_LLVL_ERR_CURL_MIME_NAME; if (curl_mime_data(field, params, CURL_ZERO_TERMINATED) != CURLE_OK) - return NEOCITIES_LLVL_ERR_CURL_MIME_DATA; - - /* filename default to sendfile when invalid */ + return NEOCITIES_LLVL_ERR_CURL_MIME_DATA;*/ field = NULL;