Skip to content

Commit

Permalink
Merge pull request #318 from igorkasyanchuk/317-readme-add-explanatio…
Browse files Browse the repository at this point in the history
…n-details-for-large-files

[Readme] Improve size validator best practices section (#317)
  • Loading branch information
Mth0158 authored Dec 5, 2024
2 parents d3cd270 + 88eb0f6 commit 86a09a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ end

#### Best practices

It is always a good practice to limit the maximum file size to a reasonable value (like 2MB for avatar images). This helps prevent server storage issues, reduces upload/download times, and ensures better performance. Large files can consume excessive bandwidth and storage space, potentially impacting both server resources and user experience. Additionally, setting size limits helps protect against malicious file uploads that could overwhelm the system.
It is always a good practice to limit the maximum file size to a reasonable value (like 2MB for avatar images). This helps prevent server storage issues, reduces upload/download times, and ensures better performance. Large files can consume excessive bandwidth and storage space, potentially impacting both server resources and user experience.
Plus, not setting a size limit inside your Rails app might lead into your server throwing a `413 Content Too Large` error, which is as nice as a Rails validatin error.

#### Error messages (I18n)

Expand Down

0 comments on commit 86a09a9

Please sign in to comment.