Skip to content

Commit d53069f

Browse files
authored
Updated the readme with detail on file upload
1 parent 3fd99c8 commit d53069f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ The `http_request` class has a set of methods you will have access to when imple
560560
* _**const std::map<std::string, std::string, http::header_comparator>** get_cookies() **const**:_ Returns a map containing all the cookies present in the HTTP request.
561561
* _**const std::map<std::string, std::string, http::header_comparator>** get_footers() **const**:_ Returns a map containing all the footers present in the HTTP request (only for http 1.1 chunked encodings).
562562
* _**const std::map<std::string, std::string, http::arg_comparator>** get_args() **const**:_ Returns all the arguments present in the HTTP request. Arguments can be (1) querystring parameters, (2) path argument (in case of parametric endpoint, (3) parameters parsed from the HTTP request body if the body is in `application/x-www-form-urlencoded` or `multipart/form-data` formats and the postprocessor is enabled in the webserver (enabled by default).
563-
* _**const std::map<std::string, file_info_s>** get_files() **const**:_ Returns information about all the uploaded files (if the files are stored to disk). This information includes the original file name, the size of the file and the path to the file in the file system.
564563
* _**const std::map<std::string, std::map<std::string, http::file_info>>** get_files() **const**:_ Returns information about all the uploaded files (if the files are stored to disk). This information includes the key (as identifier of the outer map), the original file name (as identifier of the inner map) and a class `file_info`, which includes the size of the file and the path to the file in the file system.
565564
* _**const std::string&** get_content() **const**:_ Returns the body of the HTTP request.
566565
* _**bool** content_too_large() **const**:_ Returns `true` if the body length of the HTTP request sent by the client is longer than the max allowed on the server.
@@ -575,6 +574,13 @@ The `http_request` class has a set of methods you will have access to when imple
575574
* _**gnutls_session_t** get_tls_session() **const**:_ Tests if there is am underlying TLS state of the current request.
576575
* _**gnutls_session_t** get_tls_session() **const**:_ Returns the underlying TLS state of the current request for inspection. (It is an error to call this if the state does not exist.)
577576

577+
Details on the `http::file_info` structure.
578+
579+
* _**size_t** get_file_size() **const**:_ Returns the size of the file uploaded through the HTTP request.
580+
* _**const std::string** get_file_system_file_name() **const**:_ Returns the name of the file uploaded through the HTTP request as stored on the filesystem.
581+
* _**const std::string** get_content_type() **const**:_ Returns the content type of the file uploaded through the HTTP request.
582+
* _**const std::string** get_transfer_encoding() **const**:_ Returns the transfer encoding of the file uploaded through the HTTP request.
583+
578584
#### Example of handler reading arguments from a request
579585
#include <httpserver.hpp>
580586

0 commit comments

Comments
 (0)