0

I am trying to upload file with extension m3u8 through paperclip and have content type application/vnd.apple.mpegurl. Paperclip save content type as a text/plain in database.

I have validate as below.

 validates_attachment_content_type :media,
                                    :content_type => ['application/vnd.apple.mpegurl', 'text/plain']

But it gives validation error like "file has an extension that does not match its contents"

Could you please help to fix how I can allow m3u8 extension to upload ?

Thanks in advance, Nitin

DipakSonara
  • 2,598
  • 3
  • 29
  • 34
nitinbarai
  • 26
  • 3
  • possible duplicate of http://stackoverflow.com/questions/23629888/validation-failed-upload-file-has-an-extension-that-does-not-match-its-contents – MIdhun Krishna Jul 03 '14 at 07:34
  • Yes right. but Bypass the file check by setting the file type totally from it's file extension is not working in my case.... .m3u8 gives mime-type 'text/plain' – nitinbarai Jul 04 '14 at 06:07

0 Answers0