attachinary icon indicating copy to clipboard operation
attachinary copied to clipboard

limit min and max file size upload

Open gsalin opened this issue 8 years ago • 2 comments

Hi,

Is it possible to limit minimum and maximum file size upload?

Thanks

gsalin avatar Jun 27 '17 15:06 gsalin

Yes possible with form_for:

<%= f.attachinary_file_field :content, cloudinary: { transformation: { width: 200, height: 200, crop: :limit } } %>

But for simple_form, couldn't find a way through class AttachinaryInput < SimpleForm::Inputs::Base, so this is what I did but I'm not proud:

<div class="form-group attachinary required slide_content">
  <%= f.label :content, label: '', class: 'control-label attachinary required' %>
  <%= f.attachinary_file_field :content, cloudinary: { transformation: { width: 200, height: 200, crop: :limit } } %>
</div>

fcatuhe avatar Jun 30 '17 10:06 fcatuhe

THanks a lot!

gsalin avatar Sep 22 '17 15:09 gsalin