Added a 200 MB file size limit
This commit is contained in:
parent
63acd976e7
commit
59a11ee37b
@ -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"),
|
||||
|
Loading…
Reference in New Issue
Block a user