Вопрос

I'd like to remove content type limitations for uploading files for my own needs. I did try this:

validates_attachment_content_type :attachment, :content_type => ['/\Aimage\/.*\Z/', 'application/*']

but that doesn't work, what changes should I make to allow all file types to get uploaded?

Thank you.

Это было полезно?

Решение

It should be just the matter of removing this line completely. It is not necessary for paperclip to work.

UPDATE:

This however got changed in recent Paperclip version. Now you need to specify you don't want to validate content with:

do_not_validate_attachment_file_type :attachment
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top