Plugin Author
Rinat
(@rinatkhaziev)
This is a long standing bug which I can’t reproduce.
I was able to upload a GIF: http://cl.ly/image/3n2q3K071k27
Which browsers (version and OS) this happens for you?
Initial testing on mac os x 10.8.5
safari – Version 6.0.5 (8536.30.1)
chrome – Version 30.0.1599.101
Same results.
yes I can do a jpg and mp3 and wav, really need to be able to accept .aif, .aiff and .flac
those return the ‘0’ page.
thanks for your quick response!
R
Plugin Author
Rinat
(@rinatkhaziev)
Can you show me code for your fu_allowed_mime_types filter? Any link to .aif, .aiff, and .flac small files so I could test that’d be great.
np, you just happened to catch me during my morning routine 🙂
Also when I tried a larger wav file (29 mb) it failed.
here is the code I tried: note only trying
add_filter( 'fu_allowed_mime_types', 'my_fu_allowed_mime_types' );
function my_fu_allowed_mime_types( $mime_types ) {
// Array keys should be unique
// To include all mime-types we use this workaround
// Part after | could be anything as long as it's unique
$mp3_mimes = array( 'audio/mpeg', 'audio/x-mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/mpeg3', 'audio/x-mpeg3', 'audio/mpg', 'audio/x-mpg', 'audio/x-mpegaudio' );
foreach( $mp3_mimes as $mp3_mime ) {
$mime = $mp3_mime;
preg_replace("/[^0-9a-zA-Z ]/", "", $mp3_mime );
$mime_types['mp3|mp3_' . $mp3_mime ] = $mime;
}
$mime_types['wav'] = 'audio/wav';
$mime_types['flac'] 'audio/flac';
$mime_types['aiff'] 'audio/aiff';
return $mime_types;
}
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Plugin Author
Rinat
(@rinatkhaziev)
These don’t look like complete MIME type lists for wav/flac/aiff.
See http://filext.com/file-extension/wav and http://filext.com/file-extension/aiff
A couple of notes – if I try a 29mb flac it fails with ‘0’
if I try a smaller flac – it returns on screen error:
There was an error with your submission
This kind of file is not allowed. Please, try again selecting other file.:
Top-Gun.flac
so I updated to:
/* MIME Types */
add_filter( 'fu_allowed_mime_types', 'my_fu_allowed_mime_types' );
function my_fu_allowed_mime_types( $mime_types ) {
// Array keys should be unique
// To include all mime-types we use this workaround
// Part after | could be anything as long as it's unique
$mp3_mimes = array( 'audio/mpeg', 'audio/x-mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/mpeg3', 'audio/x-mpeg3', 'audio/mpg', 'audio/x-mpg', 'audio/x-mpegaudio' );
foreach( $mp3_mimes as $mp3_mime ) {
$mime = $mp3_mime;
preg_replace("/[^0-9a-zA-Z ]/", "", $mp3_mime );
$mime_types['mp3|mp3_' . $mp3_mime ] = $mime;
}
$mime_types['wav'] = 'audio/wav, audio/x-wav, audio/wave, audio/x-pn-wav';
$mime_types['flac'] = 'audio/flac';
$mime_types['aiff'] = 'audio/aiff, audio/x-aiff, sound/aiff, audio/rmf, audio/x-rmf, audio/x-pn-aiff, audio/x-gsm, audio/mid, audio/x-midi, audio/vnd.qcelp';
return $mime_types;
}
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
I was able to figure out the ‘0’ page. It had to do with php.ini and file upload size.
still having problems with .aiff and .flac
got it working – thanks!
/* MIME Types */
add_filter( 'fu_is_debug', '__return_true' );
add_filter( 'fu_allowed_mime_types', 'my_fu_allowed_mime_types' );
function my_fu_allowed_mime_types( $mime_types ) {
// Array keys should be unique
// To include all mime-types we use this workaround
// Part after | could be anything as long as it's unique
$mime_types['flac'] = 'audio/flac';
$mime_types['flac'] = 'application/octet-stream';
// Include the rest of mp3 mimes
$mime_types['aif|aiff'] = 'audio/aiff';
return $mime_types;
}
Thanks for all your help, solution was with in your responses, just took be a while to figure it out and apply what I needed.
great plugin.