Change file size limit to 512 KiB.
This commit is contained in:
parent
e1683b889e
commit
6b37d22327
|
@ -70,13 +70,13 @@ entry_type parse_formdata()
|
||||||
|
|
||||||
for (const auto &screenshot : cgi.getFiles())
|
for (const auto &screenshot : cgi.getFiles())
|
||||||
{
|
{
|
||||||
constexpr size_t size_limit{1024 * 1024 * 1};
|
constexpr size_t size_limit{1024 * 512};
|
||||||
if (screenshot.getDataLength() > size_limit)
|
if (screenshot.getDataLength() > size_limit)
|
||||||
{
|
{
|
||||||
throw runtime_error{format("The screenshot “{0:s}” is too big. "
|
throw runtime_error{format("The screenshot “{0:s}” is too big. "
|
||||||
"The limit is {1:.1f} MiB.",
|
"The limit is {1:.1f} kilobyte (KiB).",
|
||||||
screenshot.getFilename(),
|
screenshot.getFilename(),
|
||||||
size_limit / 1024.0 / 1024)};
|
size_limit / 1024.0)};
|
||||||
}
|
}
|
||||||
|
|
||||||
const string filepath{files::get_tmpdir() / screenshot.getFilename()};
|
const string filepath{files::get_tmpdir() / screenshot.getFilename()};
|
||||||
|
|
Reference in New Issue