diff --git a/src/state/get_user.rs b/src/state/get_user.rs index a7e316e..9ec8405 100644 --- a/src/state/get_user.rs +++ b/src/state/get_user.rs @@ -17,6 +17,10 @@ fn validate_document(document: Option<&Document>) -> Result<&Document, &'static None => return Err("You didn't send a file. Try again"), }; + if document.file.size > 1024 * 1024 * 200 { + return Err("The file is larger than 200 MiB. Try splitting it into multiple files"); + } + let name = match document.file_name.as_deref() { Some(name) => Path::new(name.trim_end()), None => return Err("Couldn't get the name of the file. Try sending it again"),