From 6bb048c991a52c0b974bd4a316579f0a622a70ec Mon Sep 17 00:00:00 2001 From: ray-pixar Date: Thu, 10 Sep 2015 19:19:15 +0430 Subject: Fix for send files using multipart/form --- include/tgbot/net/HttpReqArg.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/tgbot/net') diff --git a/include/tgbot/net/HttpReqArg.h b/include/tgbot/net/HttpReqArg.h index 65f4f52..683c2b0 100644 --- a/include/tgbot/net/HttpReqArg.h +++ b/include/tgbot/net/HttpReqArg.h @@ -37,8 +37,8 @@ class HttpReqArg { public: template - HttpReqArg(const std::string& name, const T& value, bool isFile = false, const std::string& mimeType = "text/plain") : - name(name), value(boost::lexical_cast(value)), isFile(isFile), mimeType(mimeType) + HttpReqArg(const std::string& name, const T& value, bool isFile = false, const std::string& mimeType = "text/plain", std::string fileName = "") : + name(name), value(boost::lexical_cast(value)), isFile(isFile), mimeType(mimeType), fileName(fileName) { } @@ -61,6 +61,11 @@ public: * Mime type of an argument value. This field makes sense only if isFile is true. */ std::string mimeType = "text/plain"; + + /** + * Should be set if an argument value hold some file contents + */ + std::string fileName; }; } -- cgit v1.2.3