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

setting a file_size limit vs resize_to_fit #1627

Closed
m2omou opened this issue Apr 20, 2015 · 1 comment
Closed

setting a file_size limit vs resize_to_fit #1627

m2omou opened this issue Apr 20, 2015 · 1 comment

Comments

@m2omou
Copy link

m2omou commented Apr 20, 2015

I want to set the upload limit to 5MB, but I am still able to upload a 20MB file.

I'm using the following validator from https://gist.github.com/chrisbloom7/1009861:

validates :file, :file_size => { :maximum => 5.megabytes.to_i }

But my resize_to_fill is dropping my file to 5MB, so the validation is never hit.

Is it possible to check the upload limit first and then resize the file ?

@bensie
Copy link
Member

bensie commented Apr 20, 2015

This is available in master, have a look at #1026 to see how it's used.

@bensie bensie closed this as completed Apr 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants