Limit upload file type on one custom post type

I’m pretty sure $_REQUEST['post_id'] will hold the post ID you’re attaching uploads to. So something like this perhaps:

if ( isset( $_REQUEST['post_id'] ) && $post_id = absint( $_REQUEST['post_id'] ) ) {
    switch ( get_post_type( $post_id ) ) {
        case 'document' :
            if ( ! in_array( $type, array( 'pdf', 'msword', 'vnd.ms-excel' ) ) )
                $file['error'] = '...';
            break;

        case 'illustration' :
            // and so forth
    }
}