Paperclip- validate pdfs with content_type='application/octet-stream'
问题 I was using paperclip for file upload. with validations as below: validates_attachment_content_type :upload, :content_type=>['application/pdf'], :if => Proc.new { |module_file| !module_file.upload_file_name.blank? }, :message => "must be in '.pdf' format" But, my client complained today that he is not able to upload pdf . After investigating I come to know from request headers is that the file being submitted had content_type=application/octet-stream . Allowing application/octet-stream will