/*
This file is part of libhttpserver
Copyright (C) 2011, 2012, 2013, 2014, 2015 Sebastiano Merlino
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include
\n";
post_response += " \n";
post_response += "
\n";
post_response += " \n";
for (auto &file_key : req.get_files()) {
for (auto &files : file_key.second) {
post_response += " Key \n";
post_response += " Uploaded filename \n";
post_response += " File system path \n";
post_response += " File size \n";
post_response += " Content type \n";
post_response += " Transfer encoding \n";
post_response += " \n";
}
}
post_response += " ";
post_response += file_key.first;
post_response += " ";
post_response += files.first;
post_response += " ";
post_response += files.second.get_file_system_file_name();
post_response += " ";
post_response += std::to_string(files.second.get_file_size());
post_response += " ";
post_response += files.second.get_content_type();
post_response += " ";
post_response += files.second.get_transfer_encoding();
post_response += "
\n";
post_response += " back\n";
post_response += "\n";
return std::shared_ptr<:http_response>(new httpserver::string_response(post_response, 201, "text/html"));
}
};
int main(int argc, char** argv) {
// this example needs a directory as parameter
if (2 != argc) {
std::cout << "Usage: file_upload