Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the error message when a media upload exceeds the permitted threshold for the file type #989

Open
rudokemper opened this issue Mar 10, 2024 · 5 comments
Labels
beginner friendly Good for newcomers rails

Comments

@rudokemper
Copy link
Member

rudokemper commented Mar 10, 2024

Currently, when you try to upload a media attachment for a Story/Place/Speaker/User/Theme that exceeds the permitted threshold for the file type (image/audio/video/pdf), the following message is shown (for example, for photo):

Photo size {filesize} MB is not between required range

This is not the most helpful message. Let's instead show a more legible message, like:

The photo you uploaded is {filesize} MB, and exceeds the maximum permitted filesize of {maxFilesize} MB. Please reduce the size of your image and try to upload again.

Let's implement the same for all possible file types.

(Writing on a plane and don't have the proper connectivity to figure out the exact vars or threshold limits).

@rudokemper rudokemper added beginner friendly Good for newcomers rails labels Mar 10, 2024
@ughrisha
Copy link

ughrisha commented Apr 7, 2024

Hi I would like to take this up but can't find where the error is stated, could you please help. Thanks!

@rudokemper
Copy link
Member Author

Hi, thanks!

image

The new / edit views where this error message shows are in /rails/app/views/dashboard/ (for places, speakers, stories, and theme).

The relevant media filesize validations were introduced in this commit: 4e03e99

@ughrisha
Copy link

ughrisha commented Apr 7, 2024

thanks a lot!

@asimdelvi
Copy link

I would like to take up this issue if @ughrisha is working on it.

@ughrisha
Copy link

@rudokemper The task is done just sorting out some issues with stories media validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner friendly Good for newcomers rails
Projects
None yet
Development

No branches or pull requests

3 participants