drogon 413 Request Entity Too Large
问题:使用drogon upload上传文件时,一直上传失败无响应
原因:drogon的config.json配置文件中限制了上传文件的大小为1M
//client_max_body_size: Set the maximum body size of HTTP requests received by drogon. The default value is "1M".
//One can set it to "1024", "1k", "10M", "1G", etc. Setting it to "" means no limit.
"client_max_body_size": "1M",
//max_memory_body_size: Set the maximum body size in memory of HTTP requests received by drogon. The default value is "64K" bytes.
//If the body size of a HTTP request exceeds this limit, the body is stored to a temporary file for processing.
//Setting it to "" means no limit.
"client_max_memory_body_size": "64K",
//client_max_websocket_message_size: Set the maximum size of messages sent by WebSocket client. The default value is "128K".
//One can set it to "1024", "1k", "10M", "1G", etc. Setting it to "" means no limit.
"client_max_websocket_message_size": "128K",
解决:修改配置文件中client_max_body_size对应的值,如"1024", “1k”, “10M”, "1G"等等。更新config.json文件后,重新跑起drogon服务,就能上传大文件了。