Welcome Guest, Not a member yet? Register   Sign In
Help with File upload regarding File types
#1

[eluser]Unknown[/eluser]
Greetings,

I'm working on a site that accepts videos and convert them to FLV on the fly.. pretty much like a video sharing site.

Right now, I'm stuck because the file upload helper isn't accepting the file types that I've told it to allow (AVI, MPEG, MPG, MOV, FLV, WMV). I understand that the mimes.php need to be modified. I did that, but it's still not accepting some file types like FLV and MOV.

Here's the code of my mimes.php

Code:
$mimes = array(    'hqx'    =>    'application/mac-binhex40',
                'xht'    =>    'application/xhtml+xml',
                'zip'    => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
                'mid'    =>    'audio/midi',
                'midi'    =>    'audio/midi',
                'mpga'    =>    'audio/mpeg',
                'mp2'    =>    'audio/mpeg',
                'mp3'    =>    'audio/mpeg',
                'aif'    =>    'audio/x-aiff',
                'aiff'    =>    'audio/x-aiff',
                'aifc'    =>    'audio/x-aiff',
                'ram'    =>    'audio/x-pn-realaudio',
                'rm'    =>    'audio/x-pn-realaudio',
                'rpm'    =>    'audio/x-pn-realaudio-plugin',
                'ra'    =>    'audio/x-realaudio',
                'rv'    =>    'video/vnd.rn-realvideo',
                'wav'    =>    'audio/x-wav',
                'bmp'    =>    'image/bmp',
                'gif'    =>    'image/gif',
                'jpeg'    =>    array('image/jpeg', 'image/pjpeg'),
                'jpg'    =>    array('image/jpeg', 'image/pjpeg'),
                'jpe'    =>    array('image/jpeg', 'image/pjpeg'),
                'png'    =>    array('image/png',  'image/x-png'),
                'tiff'    =>    'image/tiff',
                'tif'    =>    'image/tiff',
                'css'    =>    'text/css',
                'html'    =>    'text/html',
                'htm'    =>    'text/html',
                'shtml'    =>    'text/html',
                'txt'    =>    'text/plain',
                'text'    =>    'text/plain',
                'log'    =>    array('text/plain', 'text/x-log'),
                'rtx'    =>    'text/richtext',
                'rtf'    =>    'text/rtf',
                'xml'    =>    'text/xml',
                'xsl'    =>    'text/xml',
                'mpeg'    =>    'video/mpeg',
                'mpg'    =>    'video/mpeg',
                'mpe'    =>    'video/mpeg',
                'qt'    =>    'video/quicktime',
                'mov'    =>    array('video/mov','video/quicktime'),
                'avi'    =>    array('video/avi', 'video/x-msvideo'),
                'movie'    =>    'video/x-sgi-movie',
                'doc'    =>    'application/msword',
                'word'    =>    array('application/msword', 'application/octet-stream'),
                'xl'    =>    'application/excel',
                'flv'   =>  'video/x-flv',
                'wmv'   =>  array('video/wmv', 'video/x-ms-wmv'),
                'eml'    =>    'message/rfc822'
            );

And here's what I have on my controller:

Code:
$config['allowed_types'] = 'wmv|mpg|mpeg|mov|avi|flv';


Please help me. I've been stuck for like a week now.

Any suggestion or advice would be greatly appreciated.

Thank you,
#2

[eluser]Unknown[/eluser]
Help. Anyone?
#3

[eluser]esra[/eluser]
Do a forum search for 'video'. This has come up in the past.
#4

[eluser]skrobma[/eluser]
I had the same problem and found that .flv files were being processed as 'application/octet-stream' so I added the following to mimes.php and it resolved the problem.

Code:
'flv'    =>    array('video/x-flv', 'application/octet-stream'),




Theme © iAndrew 2016 - Forum software by © MyBB