質問

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