Welcome Guest, Not a member yet? Register   Sign In
Upload woks but not for .ogg files
#1

[eluser]A_funs[/eluser]
I have a working upload script for mp3 files, the config code is below, it works fine with mp3's but with ogg files it gives the error of
"the filetype you are attempting to upload is not allowed"


Code:
$config['upload_path'] = 'songs/';
       $config['allowed_types'] = 'mp3|ogg';
       $config['max_size'] = '10000';

Any ides why this is happening?
#2

[eluser]adamck[/eluser]
In your Config folder, open mimes.php

then add
Code:
'ogg' => 'audio/ogg',

Somewhere around the mpg mime type.

Should work then Smile

The 'allowed types', only allows you to suggest things defined in the mimes.php config file.
#3

[eluser]Aken[/eluser]
Also check to see what kind of mime type the file actually carries, since sometimes the browser alters these.
#4

[eluser]Narf[/eluser]
[quote author="Aken" date="1352950676"]Also check to see what kind of mime type the file actually carries, since sometimes the browser alters these.[/quote]

What the browsers says will be ignored, there's a server-side detection of the MIME type.
#5

[eluser]A_funs[/eluser]
I added the code to the mimes.php file like below, however it is still giving me the same error...

Code:
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'ogg' => 'audio/ogg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
#6

[eluser]A_funs[/eluser]
Also I checked the mime type through the browser headers and it is coming through as audio/ogg
#7

[eluser]Narf[/eluser]
Try this: http://ellislab.com/forums/viewreply/1040236/




Theme © iAndrew 2016 - Forum software by © MyBB