How upload STL Files?
-
I have installed the frontend uploader, but I can not upload STL Files.
How can I make this possible?I already tried to copy the following code, but I get an error.
Can you please help me?Added code:
add_filter( ‘fu_allowed_mime_types’, ‘my_fu_allowed_mime_types’ );
function my_fu_allowed_mime_types( $mime_types ) {
// Array of 3gp mime types
// From http://filext.com (there might be more)
$mimes = array( ‘audio/3gpp’, ‘video/3gpp’ );
// Iterate through all mime types and add this specific mime to allow it
foreach( $mimes as $mime ) {
// Preserve the mime_type
$orig_mime = $mime;
// Leave only alphanumeric characters (needed for unique array key)
preg_replace(“/[^0-9a-zA-Z ]/”, “”, $mime );
// Workaround for unique array keys
// If you-re going to modify it for your files
// Don’t forget to change extension in array key
// E.g. $mime_types[‘pdf|pdf_’ . $mime ] = $orig_mime
$mime_types[‘3gp|3gp_’ . $mime ] = $orig_mime;
}
return $mime_types;
}
The topic ‘How upload STL Files?’ is closed to new replies.