-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CentOS 6.8 でAVIファイルがアップロードできない #134
Comments
ご指摘感謝。 MIME_TYPEでチェックしてるのは、拡張子偽装対応のためなんです。 |
調査内容。 --- .avihttps://ja.wikipedia.org/wiki/Audio_Video_Interleave
--- .mpg, .mpeg, .mpehttps://it.wikipedia.org/wiki/MPEG
--- .movhttps://ja.wikipedia.org/wiki/QuickTime
--- flvhttps://ja.wikipedia.org/wiki/Flash_Video
--- mp4https://ja.wikipedia.org/wiki/MP4
https://tools.ietf.org/html/rfc4337#section-2
application/mp4は入れない。 --- wmvhttps://ja.wikipedia.org/wiki/Windows_Media_Video
--- .asf .wmvhttps://ja.wikipedia.org/wiki/Advanced_Systems_Format
--- .wmx(対応しない)今回は対応しない。 wmxサンプル
debuglog
|
PHP の mimetype の判定は、 試しにテキストファイルの拡張子を '.avi' としたところ、ある環境の php では 'video/x-msvideo' と判定されます。 |
連絡ありがとう。 ubuntu12.04でmime typeのバリデーションチェックを確認した時は、拡張子偽装したら、ちゃんとチェックしてくれたんだけどなぁ。 気になって調べてみました。 |
※ 3.0.1 でリリースされたバージョンで確認。
CentOS 6.8環境で AVI ファイルをアップロードしたが、アップロード不可のファイルと認識されてしまう。
Videos/Model/Behavior/VideoValidationBehavior.php の mimetype 判定処理が原因。
Videos/Model/Video.php の VIDEO_MIME_TYPE に 「video/x-msvideo」 を追加することによって回避は可能だが、環境により mymetype は異なるため、拡張子による判断にした方が無難。
The text was updated successfully, but these errors were encountered: