I have a little upload form and it works for JPG’s. Here is the model.
class UploadForm extends CFormModel {
public $image;
public function rules() {
return array(
array('image', 'file', 'types' => 'jpg, gif, png, mp4, ogg, MP4, OGG'),
);
}
}
However, I can not get it to upload videos. It always comes back wit the error message:
[html]The file "movie.mp4" cannot be uploaded. Only files with these extensions are allowed: jpg, gif, png.[/html]
Size is not the issue. When I rename movie.mp4 to movie.jpg, it uploads just fine. I thought rules determined what the validator what allows. But apparently that is controlled from somewhere else.
How do I get this to work for MP4 and OGG video files?
Postscript: What I wrote above is not correct. When I upload the movie renamed as movie.jpg, I do not get any error message. Also, the file passes validation in my controller.
However, the file is not actually being uploaded…