Skip to content

Commit

Permalink
Increase max file upload size limit (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzernik authored Jul 29, 2022
1 parent b6571fa commit 9a1b052
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Rocket.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[default.databases.squeakroad]
url = "db.sqlite"

[default.limits]
file = "10 MiB"
data-form="10 MiB"
3 changes: 0 additions & 3 deletions src/update_listing_images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ async fn upload_image(
if tmp_file.len() == 0 {
return Err("File is empty.".to_string());
};
if tmp_file.len() >= 1000000 {
return Err("File is bigger than maximum allowed size.".to_string());
};

let image_bytes = get_file_bytes(tmp_file).map_err(|_| "failed to get bytes.")?;

Expand Down

0 comments on commit 9a1b052

Please sign in to comment.