Friday, June 1, 2012

Codeigniter flv,wmv uploading gives error “Invalid file type”


It gives “The filetype you are attempting to upload is not allowed.” error when I was trying to upload flv and wmv files using codeigiter “upload” library.
I was sure about $config array. But this error was there when I was trying video upload.
My $config settings were as follows.
//CodeIgniter Code
$configVideo['upload_path'] = './upload/video';
$configVideo['max_size'] = '10240';
$configVideo['allowed_types'] = 'avi|flv|wmv|mp3';
$configVideo['overwrite'] = FALSE;
$configVideo['remove_spaces'] = TRUE;
$video_name = $_FILES['video']['name'];
Solution:  
Open mimes.php file in config folder
Add folowing two lines into the $mimes array
'wmv'=>array('video/wmv', 'video/x-ms-wmv', 'flv-application/octet-stream', 'application/octet-stream'),
 'flv' =>array('video/flv', 'video/x-flv', 'flv-application/octet-stream', 'application/octet-stream'),
Hope this will help you out..
Thanks for visiting my blog.. 


3 comments:

  1. as for me, i prefer to convert flash to video using this tool http://www.macvide.com/Macvide_FlashVideo_Converter/, it's easy-to-use and works great!)

    ReplyDelete
  2. Thanks Kiki for sharing such kind of great link.. :)

    ReplyDelete

Please Comment Here!

How to backup and download Database using PHP

< ?php $mysqlUserName = 'databaseusername' ; $mysqlPassword = 'databasepassword' ; $mysqlHostNa...