mercredi 13 mai 2015

Unable to upload video from iphon using paperclip-ffmpeg in ruby on rails

when i upload video from iphon then I am getting below error.

It works perfectly when I upload same video from desktop.

Command :: PATH=/usr/bin/:$PATH; file -b --mime '/tmp/6da355e988ec841811d8803dfd5cf44c20150513-8103-b4lkam.MOV'
[paperclip] Content Type Spoof: Filename IMG_2637.MOV (["video/quicktime"]), content type discovered from file command: inode/x-empty. See documentation to allow this combination.
(0.6ms)  ROLLBACK
Completed 400 Bad Request in 58ms (Views: 0.9ms | ActiveRecord: 5.0ms)

I used gems "paperclip", "~> 4.1" and 'paperclip-ffmpeg'

and in video model i used

validates_attachment_content_type :student_video, content_type: /\Avideo\/.*\Z/

also tried out

validates_attachment_content_type :student_video, :content_type => ['video/x-   
#                                        msvideo', 'video/avi', 'video/quicktime', 'video/3gpp', 'video/x-ms-
#                                        wmv', 'video/mp4', 'flv-application/octet-stream', 'video/x-
#                                        flv', 'video/mpeg', 'video/mpeg4', 'video/x-la-asf', 'video/x-ms-asf']

but i m getting same error.

I do not know what was an error.

please help me.

thanks in advance.

Aucun commentaire:

Enregistrer un commentaire